Sunday 28 April 2013

Determine the size of each individual file in a folder from Terminal: ls -l

So for some reason you've got a folder with loads of files in it and you want to find out their contents using the terminal. The solution is quite easy.

1. Enter sudo -i & your password to prevent any annoying permission denied messages.

2. Enter ls -l /home/yourname/folder or whatever the path to your folder is. 

And that's it. Easy.

Quickly Cut and Trim Any Video File

So you've got this video file that's taking up a lot of space. You've noticed it's 2-3 hours long but really you only need 20-30 minutes of it. This is going to show you how to chop it up.

Open the terminal and enter this command, changing (00:15:00 -t 00:45:23) to whatever length you're looking for and original.mp4 & output.mp4 as appropriate.

ffmpeg -acodec copy -vcodec copy -ss 00:15:00 -t 00:45:23 -i original.mp4 output.mp4

So that command above would take the original.mp4 file and create a smaller output.mp4 file consisting of original.mp4's 15 minute mark to 45 minute 23 mark.

If you prefer a GUI can also do this using AviDemux available from the software centre but from my experience this takes a longgg time (it needs to build the file - or something) whereas in the terminal it takes a matter of seconds.

Monday 22 April 2013

How to play a Video with a Vorbis.acm (vo3+) Audio Codec - uBuntu 12.10

Lately I've been getting the following error when trying to play video files:

"No suitable decoder module: VLC does not support the audio or video format "vo3+". Unfortunately there is no way for you to fix this."

We'll see about that.

It's an audio codec problem (duh) and the absent codec is vorbis.acm, which if my casual Google searches are correct is a Japanese codec.


My initial thought was simply install the codec but I found a faster method. However, it's available here, if you're willing to go that route.



But here's what I did (this should take about 20-25 minutes)

1. Install Avidemux from the software centre.

2. Open the file and rip the audio.

   Open -> File (Open the video file with the vo3+ audio)

   Audio -> Save (This'll rip the audio to a location of your choosing)

It's a good idea to save the audio in Home to make the next step easier.

3. Download ogmtools (available from software centre) and run ogmdemux.

   ogmdemux -nv -v /home/username/sample.ogg (or wherever your file is located)

(-nv because there's no video stream, -v to show the process in terminal)

The output file should be in your home folder, regardless of where the input file was.

4. Install Sound Converter from the Software centre.

So by now you should now have a working audio file still in .ogg format.
All that's left is to tack it back to the original video.

Open the audio file in Sound Converter then go

   Preferences -> Type of Result -> mp3

Then hit convert. This should take a few minutes depending on how big your file is and the quality you want it to be in. Afterwards you should have a working .mp3 audio file.

5. Last step - Open Avidemux again then open the video file.

   Audio -> MP3-Lame (Drop down menu - Change from Copy)

Now this time from the top menu:

   Audio -> Main Track -> External Mp3 -> (Select mp3 File)

Finally:

   File -> Save -> Save Video

And you should now have a video file with working audio.

Sponsored Links