04 Sep, 2008
Converting audio/video from one format to another
Posted by: James In: Entertainment Centre|Linux
Over the past couple of years I have needed to convert audio and video files from one format/container to another.
Here I hope to archive all the useful commands that I use to get the job done.
.mkv to divx
I found a cool little script from HowForge.com that uses mencoder for conversion.
#!/bin/sh INPUT=$1 OUTPUT=$2 mplayer "$INPUT" -ao pcm:fast:file=audio.wav -vc null -vo null mencoder "$INPUT" \ -ffourcc divx \ -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=400 \ -audiofile audio.wav \ -oac mp3lame -lameopts vbr=3 \ -slang eng \ -sws 2 -vf scale=352:-3 \ -o "$OUTPUT" rm -f audio.wav
Make sure you have mencoder installed and that the script file has execute permissions.
./mkvtodivx video.mkv video.avi
Flash Video to mpeg
If you ever download videos from Youtube.com or the like you can turn flv files into mpegs
ffmpeg -i youtube_vid.flv new_vid.mpg
There are many ways to download flash videos such as:
- Third party websites such www.Keepvid.com
- Open your favorite file manager and go to .mozilla > firefox > profile in use > Cache. There you can see all the downloaded data. If you sort the directory listing by date last modified you can grab the flv file. They are usually named like so “0E2E14FBd01″ without extension.
- There are a number of firefox extensions that allow one click downloading of embeded media
- Also under the Tools menu under Page Info, you can download the files found within the page such as embeded media files.
OGG to MP3
This requires the package “sox” to be installed:
sox file.ogg file.mp3
Have a useful command you would like to share? Add it to the comments section.
Tweet This
Recent Comments