video converter - ffmpeg
September 25th, 2006 mysurface Posted in Misc, chmod, ffmpeg | Hits: 24882 |
I get to know this command because my mplayer having problem playing flv downloaded from youtube. Therefore I google it and found that it is a command line can actually convert it into mpg.
To convert flv, let say myvideo.flv to myvideo.mpg, you can do this:
ffmpeg -i myvideo.flv -ar 22050 -b 500 -s 320x240 myvideo.mpg
I check out man for ffmpeg, i couldn’t find at my local machine and I search from the internet, it is quite brief.
Anyway, -i is input, -ar is to set audio sample rate to 22050 Hz, -b is to make it DIVX compatible -s defines its video size.
I turn it into script so that it is easy to trigger next time.
#!/bin/sh
if [ -n "$1" -a -n "$2" ]
then
ffmpeg -i $1 -ar 22050 -b 500 -s 320x240 $2
else
echo "Usage: `basename $0` source.flv target.mpg"
fi
if [-n "$1" -a -n "$2"] is actually check to see if source and destination video is not specified, then display the usage.
Copy these line into a text file call flv2mpg and change it to executable by doing this
chmod a+x flv2mpg
So next time if want to convert to mpg, just do this
./flv2mpg myvideo.{flv,mpg}
Live Chat!







March 24th, 2007 at 6:26 am
I tried doing that but it said that the file is truncated and/or corrupted… and im not really sure what to do…
March 24th, 2007 at 6:35 am
And it says permission denied…
March 24th, 2007 at 3:09 pm
File truncated or corrupted probably means your flv, I am not sure, you didn’t mention what have you did to get this.
Same to permission denied, it probably means you haven’t chmod to the script? or other reason..
June 30th, 2007 at 5:55 pm
[...] -i is input file, -ar is audio rate in Hz. Just a slides of time, and you are done. And good thing about command line is you can put that into a bash script to do a batch converts. Related Posts video converter - ffmpeg I get to know this command because my mplayer having problem playing flv downloaded from youtube. Therefore I google it … [...]
September 10th, 2007 at 1:46 pm
hi..
i have tried this but its saying that “fmpeg.exe has encountered a problem and needs to close. We are sorry for the inconvenience.”
September 13th, 2007 at 12:54 pm
Your script is OK. I worked perfectly with me. Thanks!
January 20th, 2008 at 11:49 am
[...] beberapa situs yang membahas topik ini, antara lain adalah Linux By Examples yang membahas bagaimana “membungkus” ffmpeg menjadi sebuah skrip yang mudah [...]
May 6th, 2008 at 11:31 pm
Awesome post. Thanks for the info, very useful
June 10th, 2008 at 3:46 pm
YouTubeRobot.com today announces YouTube Robot 2.0, a tool that enables you to download video from YouTube.com onto your PC, convert it to various formats to watch it when you are on the road on mobile devices like mobile phone, iPod, iPhone, Pocket PC, PSP, or Zune.
YouTube Robot allows you to search for videos using keywords or browse video by category, author, channel, language, tags, etc. When you find something noteworthy, you can preview the video right in YouTube Robot and then download it onto the hard disk drive. The speed, at which you will be downloading, is very high: up to 5 times faster than other software when you download a single file and up to 4 times faster when you download multiple files at a time.
Manual download is not the only option with YouTube Robot. You may as well schedule the download and conversion tasks to be executed automatically, even when you are not around. Downloading is followed by conversion to the format of your choice and uploading videos to a mobile device (if needed). For example, you can plug in iPod, select the video, go to bed, and when you wake up next morning, your iPod will be ready to play new YouTube videos.
Product page: http://www.youtuberobot.com
Direct download link: http://www.youtuberobot.com/download/utuberobot.exe
Company web-site: http://www.youtuberobot.com
E-mail: support@youtuberobot.com
September 16th, 2008 at 7:58 pm
[...] video converter - ffmpeg I get to know this command because my mplayer having problem playing flv downloaded from youtube. Therefore I google it … [...]
August 29th, 2009 at 5:40 am
Hi you there, and thanks for this powerful converter, it\’s so useful.
I ask for: man ffmpeg, and the prompt just display it, I\’m using Ubuntu 9.04, but this should be the same for all distros.
Anyway, thanX for the great info.