bhachuj
01-19-2009, 06:14 PM
This can be done very easily thanks to the very powerful ffmpeg.
1. Check your file ratio:
$ffmpeg -i your_input_file
You'll get something like this:
Quote
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-liba52 --enable-libxvid --enable-libx264 --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --enable-x11grab --disable-swscale
libavutil version: 49.7.0
libavcodec version: 51.60.0
libavformat version: 52.17.0
libavdevice version: 52.0.0
built on Jul 21 2008 23:23:28, gcc: 4.3.1 20080626 (prerelease)
Input #0, avi, from 'media/movies/docs/StealThisFilm2/Steal This Film II.Xvid.avi':
Duration: 00:44:43.84, start: 0.000000, bitrate: 1999 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 704x400 [PAR 1:1 DAR 44:25], 25.00 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Must supply at least one output file
So we want to convert to 320 x (400x320/704) that's 320 x 182. (Beware, it must be a multiple of 2!)
Almost done now, just type the following command:
$ffmpeg -i your_input_file -f mp4 -vcodec libxvid -maxrate 1000 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -s 320x136 -acodec libfaac your_output_file.mp4
you can use the following flag if you have dual core cpu:
-threads 2 (not supported in older ffmpeg version)
Done!
You can also use avidemux which has some nice presets for that (slower than ffmpeg)
1. Check your file ratio:
$ffmpeg -i your_input_file
You'll get something like this:
Quote
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-liba52 --enable-libxvid --enable-libx264 --enable-libtheora --enable-postproc --enable-shared --enable-pthreads --enable-x11grab --disable-swscale
libavutil version: 49.7.0
libavcodec version: 51.60.0
libavformat version: 52.17.0
libavdevice version: 52.0.0
built on Jul 21 2008 23:23:28, gcc: 4.3.1 20080626 (prerelease)
Input #0, avi, from 'media/movies/docs/StealThisFilm2/Steal This Film II.Xvid.avi':
Duration: 00:44:43.84, start: 0.000000, bitrate: 1999 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 704x400 [PAR 1:1 DAR 44:25], 25.00 tb(r)
Stream #0.1: Audio: mp3, 48000 Hz, stereo, 128 kb/s
Must supply at least one output file
So we want to convert to 320 x (400x320/704) that's 320 x 182. (Beware, it must be a multiple of 2!)
Almost done now, just type the following command:
$ffmpeg -i your_input_file -f mp4 -vcodec libxvid -maxrate 1000 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -s 320x136 -acodec libfaac your_output_file.mp4
you can use the following flag if you have dual core cpu:
-threads 2 (not supported in older ffmpeg version)
Done!
You can also use avidemux which has some nice presets for that (slower than ffmpeg)