I'm looking for a command line method (or script) to perform a conversion from MPEG-2 to anything compatible with Divx Home Theater Profile, so they can be played on a Divx Certified player (not Ultra Certified).
I have tried various incantations with ffmpeg, and although my output is reported as divx with no qpel or gmc, they won't play on my player. Does anyone know what options to give ffmpeg to create a Home Theater Profile compatible output file? Or another command line based conversion tool, with a sample invocation? Primarily I am converting 4:3 sources, 640x480, with minimal fast action sequences (think home movies as a reference).
Most of what I find for conversions with profiles use a GUI. Due to the volume involved, I want to use CLI instead of manually building a list to batch. The conversion would be done under WinXP (32 bit) with a quad core Q6700.
+ Reply to Thread
Results 1 to 16 of 16
-
-
You might try mencoder, which is able to call the DivX/XviD's vfw DLLs.
{ http://www.mplayerhq.hu/DOCS/man/en/mplayer.1.html } -
What model player do you have? Download AVIcheck http://fer.peque.org/avicheck.htm and post a screenshot of one of your non working files.
-
Originally Posted by Soopafresh
and here is MediaInfo for the exact same file:
-
I would recommend you close GOPs when using ffmpeg. for example, try this: ffmpeg -i "input" -s vga -vcodec libxvid -bf 1 -b 850k -mbd 2 -g 300 -flags cgop -acodec libmp3lame -ab 128k -ac 2 "output.avi"
If you want to deinterlace use the -deinterlace option.
This will create a divx file with the fourCC set to XVID.
Try it. -
Weird. Looks like it would work. If you wouldn't mind, download AVI_Gain from https://forum.videohelp.com/topic314909.html and run your file through any of the normalizing batch files. When the file gets remuxed, the DivX 4CC gets added to the file. Maybe it's that.
-
Originally Posted by Soopafresh
I used the AVI_GAIN_Regular.BAT option. That did clear up the AviCheck issue of claiming the audio bitrate was 0. However, the video still would not play. See also my reply to VirtualDoobMon. -
Originally Posted by VirtualDoobMon
I installed the latest ffmpeg I could find, SVN-r12920, which is about two weeks old. It didn't like -flags either.
But I can't find where to get libxvid or libmp3lame for a WinXP system. I found a xvidcore-1.1.3.zip file which is also two weeks old, but from what I can tell it doesn't give me the libxvid encoder either.
I must not be googling the right search terms, as I can't find how to install support for libxvid or libmp3lame under WinXP. Can anyone point me in the right direction? -
Install WinFF . It has many different profiles which might to the job. You can copy the command line parameters if one of them works for you. Or WinMenc for Mencoder. http://winmenc.blogspot.com/
-
Originally Posted by Midzuki
But I am going to try mencoder too -- I just have to experiment with the options to give it. -
Try this version of ffmpeg. I included an example command line usage batch file - modify it for your file type that you're converting and the file dimensions
ffmpeg_xvid.rar
With Winmenc, you can save the batch file once you've found the correct config:
http://www.badongo.com/file/3605671
-
An update for the sake of the archives, or anyone who cares:
Using the ffmpeg linked above or the version with WinFF, I was able to produce videos which would play but I still had these issues:- - AviCheck still reported my audio bitrate as 0, and I would not get any sound from a Divx certified player
- I could correct the above using the avi_gain scripts (and could probably coerce ffmpeg to do it the first time if I messed with it)
- The avg video bitrate would come out quite a bit higher than I requested on the command line, which threw off my calcs for a desired target size
- The video would not fast forward or rewind on a Toshiba D-VR600 (only play) but would FF and rewind on a Toshiba SD-K850
So I played with various mencoder options, and it looks like I will be settling on it. When I use two-pass mode, it does very good at hitting my requested bitrate so I can run pretty tight tolerances on my target size. The video will play, FF, and rewind on both the Divx certified players I have at my disposal (Toshiba D-VR600 and SD-K850). I may do more tweaks, but for the record, here are my current CLI arguments I am using:
Pass 1:
mencoder.exe "(input)" -ffourcc XVID -vf-add scale=640:480 -ovc xvid -xvidencopts profile=dxnhtntsc:bitrate=xxxx:threads=4:turboass=1 -nosound -o NUL;
Pass 2:
mencoder.exe "(input)" -ffourcc XVID -vf-add scale=640:480 -ovc xvid -xvidencopts profile=dxnhtntsc:bitrate=xxxx:threads=4ass=2 -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o "(output).avi"
I am using threads=4 since I have a quad core Q6700, but my CPU only averages a little above 50%. All four cores are in use but none are maxed out. Can mencoder take advantage of more threads than you have CPU cores? - - AviCheck still reported my audio bitrate as 0, and I would not get any sound from a Divx certified player
-
if you're using mpeg4 with ffmpeg don't use b-frames but make sure you set your GOPs and the
ffourcc to XVID or DX50.
if you want to encode to xvid with ffmpeg then the example i gave earlier will work.
As stated by others, use current builds of ffmpeg. With the newer builds you will have to use
Libxvid instead of just xvid and libmp3lame in place of mp3.
mencoder will of course work as well but i have found with the profiles sometimes the file
won't playback on certain standalones. If this is ever the case for you just rebuild the index.
ie: mencoder -ovc copy -oac copy -forceidx input -o output
If that doesn't work use avimux_gui and use the standalone with mp3 profile.
cheers -
Thanks for all the suggestions. I may try another ffmpeg build for comparisons, but so far it looks like mencoder will do what I want. It is running lower CPU utilization than I'd expect, but increasing the threads count for the xvidencopts doesn't seem to improve performance that much, nor increase the CPU utilization that much. I have a quad core Q6700, so initially set the -threads to 4. The mencoder docs list -xvidencopts threads=x description is:
Create n threads to run the motion estimation (default: 0). The maximum number of threads that can be used is the picture height divided by 16.
I'm seeing times around 110-120fps for pass 1 and 55-60fps for pass 2, so the net effect is I process around 45fps. Thus the compression takes roughly 2/3 of the play time for a video. I can live with that if I need to, but wouldn't object to an increase if anyone can see anything I could change with the sample command line listed above. I am using mencoder dev-SVN-r23237-3.4.2 which reports:
MEncoder dev-SVN-r23237-3.4.2 (C) 2000-2007 MPlayer Team
CPU: Intel(R) Core(TM)2 Quad CPU Q6700 @ 2.66GHz (Family: 6, Model: 15, Step
ping: 11)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Similar Threads
-
Anyone Can Help to Convert This Preset to FFmpeg Command Line?
By raymng in forum Video ConversionReplies: 2Last Post: 26th Feb 2012, 12:11 -
How Can I Convert An MPEG-2 To AVI via command line to achive target size
By onesikgypo in forum Video ConversionReplies: 19Last Post: 22nd Jan 2010, 11:46 -
meGUI - XviD: Home Theater profile bitrate issues.
By blackflames in forum Video ConversionReplies: 0Last Post: 4th Dec 2009, 09:26 -
Using ffmpeg command line to convert a .vob(DVD) to avi/mpeg
By alfo666 in forum Newbie / General discussionsReplies: 1Last Post: 13th Sep 2009, 03:14 -
Automatic selection PAL NTSC & command line switch method
By joecon in forum Capturing and VCRReplies: 0Last Post: 13th Sep 2007, 07:13