convert youtube (flv) videos to mpeg
Hi all,
As some know a few months ago I wrote a small guide teaching about download and convert youtube videos , but every time I need to convert a flv video I access my blog because I never remember full command. So, I wrote a small script to do it. It’s easy.
The video is I like to move it .
~/pessoal/videos $ ls | grep i_like
i_like_to_move_it.flv
The script is here. You need to copy and paste the lines and give the file permission to execute.
~/pessoal/videos $ chmod +x convert_flv_mpg.sh ; cat convert_flv_mpg.sh
name=`echo $1 | cut -f1 -d.`
ffmpeg -i $name.flv -ab 56 -ar 22050 -b 500 -s 320×240 $name.mpg
Execute the script using the video name as a parameter.
~/pessoal/videos $ ./convert_flv_mpg.sh i_like_to_move_it.flv
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: –enable-gpl –enable-pp –enable-pthreads –enable-vorbis –enable-libogg –enable-a52 –enable-dts –enable-libgsm –enable-dc1394 –disable-debug –enable-shared –prefix=/usr
libavutil version: 0d.49.0.0
libavcodec version: 0d.51.11.0
libavformat version: 0d.50.5.0
built on Mar 26 2007 15:50:40, gcc: 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
Seems that stream 1 comes from film source: 1000.00 (1000/1) -> 29.97 (30000/1001)
Input #0, flv, from ‘i_like_to_move_it.flv’:
Duration: 00:02:48.6, bitrate: N/A
Stream #0.0: Audio: mp3, 22050 Hz, mono
Stream #0.1: Video: flv, yuv420p, 320×240, 29.97 fps(r)
Output #0, mpeg, to ‘i_like_to_move_it.mpg’:
Stream #0.0: Video: mpeg1video, yuv420p, 320×240, q=2-31, 500 kb/s, 29.97 fps(c)
Stream #0.1: Audio: mp2, 22050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
[mpeg1video @ 0xb7dfdf08]warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xb7dfdf08]warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xb7dfdf08]warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xb7dfdf08]warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xb7dfdf08]warning, clipping 1 dct coefficients to -255..255
frame= 5054 q=5.2 Lsize= 11776kB time=168.4 bitrate= 572.7kbits/s
video:10501kB audio:1151kB global headers:0kB muxing overhead 1.056632%
Now, there is a new video with mpeg format.
~/pessoal/videos $ ls | grep i_like
i_like_to_move_it.flv
i_like_to_move_it.mpg
~/pessoal/videos $