dideldum
19th December 2007, 13:19
Hallo,
I've used DivX on Windows for years now, but as converting videos was the last reason to use Windows and everything else I do on Linux, I want to switch to XVid finally.
I used Dr.DivX 2.0.0b2 with DivX encoder 6.4, even if there were newer versions. Dr.DivX broke the Preview window with newer versions (cropping was not made visible) and anyway was not updated to handle encoder versions newer than 6.6.
With this configuration I was quite satisfied regarding speed and quality. I use the highest quality encoder option (insane) with autocropping, lanczos4(fast)-resizing, imagesize usually 704x544 (PAL, 4:3) or sometimes 720x400 (PAL, 16:9) with a bitrate of 1400, converting with 2pass(fast 1st pass). This is my standard, which works with a perfect quality for practically everthing (movies, series, anime).
With Dr.Divx 2.0.0b2, DivX 6.4, Windows XP (32bit) on a Core2Duo E6300, 2GB RAM converting needs more or less the video time, e.g. one episode of "Home Improvement" (~21min) needs 1 minute for the audio conversion to mp3 (only 1cpu used with 100%), 5 minutes for the fast 1st pass (about 100fps at 80% of both cpus) and 15 minutes for the second pass (about 34fps at 80% of both cpus). This is typical for any conversion I do.
Now I tried the same epsiode with XVid on the same machine using gentoo 2007.0 x86_64 with my own 2.6.22-r9 SMP 64bit kernel.
First of all I noticed, that the XVid package is single-threaded. I found on the Internet a multithreaded version, but this is not packaged in Gentoo, so I haven't tried it so far.
I tried a 2 pass encoding with the following commands:
mencoder home_improvement_episode.mpg -nosound -ovc xvid -xvidencopts pass=1:bitrate=1400:turbo -sws 9 -vf crop=696:572:20:2,scale=704:544 -o /dev/null
mencoder home_improvement_episode.mpg -oac mp3lame -ovc xvid -xvidencopts pass=2:bitrate=1400 -sws 9 -vf crop=696:572:20:2,scale=704:544 -o /video/converted/home_improvement_episode.avi
The cropping and resizing values are the same as I used with DivX under Windows. I don't know, which version of Lanczos is the resisizing method (-sws 9), the man-page only says "Lanczos", in Dr.DivX I used "Lanczos4(fast)".
Unfortunately the 1st pass was running only with 17fps (about 6 times slower than the 1st pass in Dr. DivX). As my DivX 1st pass was multithreaded and the Xvid lib is singlethreaded, I could understand half the speed, but 1/6th?
The second pass with XVid was running faster than the 1st (with 21fps). This is surprising for me, because I set "turbo" to the first, but not to the second pass. Comparing to 34fps with multithreaded DivX the second pass of Xvid conversion with singlethreaded 21fps seemed better (though I doubt to reach 42fps with multithreaded Xvid in second pass), but the overall conversion time was still much longer than Dr.DivX on Windows.
I guess, I could improve things with the right switches and here I ask XVid-professionals for their help (thanks for reading patently until here, btw).
How can I tune the XVid conversion with mencoder or another tool (I tried avidemux, but the first pass was even slower: 7fps, in spite of setting turbo in the preferences!) to get the same high quality as I had with my DivX settings with a similar speed as Dr.DivX?
I want to stay with a bitrate of 1400 as this gave me a perfect quality for anything. I really don't want to test always, if 1300 or 1100 or 900 would also do it...
I want to stay with the high PAL resolution as I watch the converted videos later on a normal TV/beamer.
Regarding the resulting size: my converted DivX videos are normally factor 2.2 to 3 smaller than the original mpg (650MB Home Improvement as mpg are ~250MB DivX with my settings). I would like to reach more or less the same compression with XVid, but I really don't care about 30MB more or less, finally the episodes are stored on DVD and it doesn't matter, if there are 16 or 18 episodes on one DVD.
I would really appreciate your help to use XVid encoding under Linux with same quality and similar speed as I know it from DivX under Windows, as this would finally let me get rid of Windows completely!
dideldum
I've used DivX on Windows for years now, but as converting videos was the last reason to use Windows and everything else I do on Linux, I want to switch to XVid finally.
I used Dr.DivX 2.0.0b2 with DivX encoder 6.4, even if there were newer versions. Dr.DivX broke the Preview window with newer versions (cropping was not made visible) and anyway was not updated to handle encoder versions newer than 6.6.
With this configuration I was quite satisfied regarding speed and quality. I use the highest quality encoder option (insane) with autocropping, lanczos4(fast)-resizing, imagesize usually 704x544 (PAL, 4:3) or sometimes 720x400 (PAL, 16:9) with a bitrate of 1400, converting with 2pass(fast 1st pass). This is my standard, which works with a perfect quality for practically everthing (movies, series, anime).
With Dr.Divx 2.0.0b2, DivX 6.4, Windows XP (32bit) on a Core2Duo E6300, 2GB RAM converting needs more or less the video time, e.g. one episode of "Home Improvement" (~21min) needs 1 minute for the audio conversion to mp3 (only 1cpu used with 100%), 5 minutes for the fast 1st pass (about 100fps at 80% of both cpus) and 15 minutes for the second pass (about 34fps at 80% of both cpus). This is typical for any conversion I do.
Now I tried the same epsiode with XVid on the same machine using gentoo 2007.0 x86_64 with my own 2.6.22-r9 SMP 64bit kernel.
First of all I noticed, that the XVid package is single-threaded. I found on the Internet a multithreaded version, but this is not packaged in Gentoo, so I haven't tried it so far.
I tried a 2 pass encoding with the following commands:
mencoder home_improvement_episode.mpg -nosound -ovc xvid -xvidencopts pass=1:bitrate=1400:turbo -sws 9 -vf crop=696:572:20:2,scale=704:544 -o /dev/null
mencoder home_improvement_episode.mpg -oac mp3lame -ovc xvid -xvidencopts pass=2:bitrate=1400 -sws 9 -vf crop=696:572:20:2,scale=704:544 -o /video/converted/home_improvement_episode.avi
The cropping and resizing values are the same as I used with DivX under Windows. I don't know, which version of Lanczos is the resisizing method (-sws 9), the man-page only says "Lanczos", in Dr.DivX I used "Lanczos4(fast)".
Unfortunately the 1st pass was running only with 17fps (about 6 times slower than the 1st pass in Dr. DivX). As my DivX 1st pass was multithreaded and the Xvid lib is singlethreaded, I could understand half the speed, but 1/6th?
The second pass with XVid was running faster than the 1st (with 21fps). This is surprising for me, because I set "turbo" to the first, but not to the second pass. Comparing to 34fps with multithreaded DivX the second pass of Xvid conversion with singlethreaded 21fps seemed better (though I doubt to reach 42fps with multithreaded Xvid in second pass), but the overall conversion time was still much longer than Dr.DivX on Windows.
I guess, I could improve things with the right switches and here I ask XVid-professionals for their help (thanks for reading patently until here, btw).
How can I tune the XVid conversion with mencoder or another tool (I tried avidemux, but the first pass was even slower: 7fps, in spite of setting turbo in the preferences!) to get the same high quality as I had with my DivX settings with a similar speed as Dr.DivX?
I want to stay with a bitrate of 1400 as this gave me a perfect quality for anything. I really don't want to test always, if 1300 or 1100 or 900 would also do it...
I want to stay with the high PAL resolution as I watch the converted videos later on a normal TV/beamer.
Regarding the resulting size: my converted DivX videos are normally factor 2.2 to 3 smaller than the original mpg (650MB Home Improvement as mpg are ~250MB DivX with my settings). I would like to reach more or less the same compression with XVid, but I really don't care about 30MB more or less, finally the episodes are stored on DVD and it doesn't matter, if there are 16 or 18 episodes on one DVD.
I would really appreciate your help to use XVid encoding under Linux with same quality and similar speed as I know it from DivX under Windows, as this would finally let me get rid of Windows completely!
dideldum