6

I wanted to convert a file so I can play it my DVD player which only works with divx/xvid. I tried :

ffmpeg.exe -y -i "in.mp4" -t 480.00 -vf scale=720:301,pad=720:576:0:137 -map 0:v:0 -map 0:1 -b:v 2500K -vcodec libxvid -aspect 1.25 -b:a:0 128K -ac:a:0 2 -ar:a:0 48000 -codec:a:0 libmp3lame "out.avi"

I wanted to know what options I should use for the resulting file to also have these characteristics (as close as possible to the "Divx Home Theater" profile):

Macroblocks: 40500 bps
VBV Buffer: 384kB
VBV Bitrate: 4854 kbps
B-Frame: 1

My ffmpeg build info is:

ffmpeg version 2.2.git built on Sep 28 2014 08:33:32 with gcc 4.6.2 (GCC)

Also my OS is Windows 7 x64

poqdavid
  • 663

2 Answers2

6

FFmpeg wiki has a page about this: MPEG-4 Encoding Guide.

Long story short: ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi

There are, of course, different support levels on different devices. The email exchange about a very limited device Need code to convert MP4 to DivX AVI seems to point at a lower level standard (use it if you can't test the device beforehand):

ffmpeg -i input.mkv -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v libxvid \
    -crf 24 -vtag DIVX -vf scale=640:480 -aspect 4:3 -mbd rd -flags +mv4+aic \
    -trellis 2 -cmp 2 -subcmp 2 -g 30 -vb 1500k output.avi
MarianD
  • 2,726
6

Personally I use these options:

ffmpeg -i INPUT_FILE -c:v libxvid -q:v 5 -q:a 5 OUTPUT_FILE.avi

The point that I would like to stress is that the option -q:v 5 is crucial. This option sets the quality of the video (1 = best, 31 = worse). When this option is omitted, I got a compatible file of poor quality.