View Full Version : Help encoding Xvid for XBMC playback?
jthunder
4th May 2005, 04:50
I have had some success playing around with encoding levels for 1280x720 xvid files, and then getting good playback results on xbmc/mplayer.
My question is what method should I use for encoding 720p files (divx, xvid, wmvhd, etc) that will result in playback without dropped frames on xmbc.
I know that it is CPU limited but I have had some success, so part of me hopes that it is just a bitrate option, or quantizer, or something I don't know, as I have limited knowledge of the codec.
Thanks again.
JT
Emp3r0r
4th May 2005, 05:23
resize to 960x720 animorphic
do not use qpel, gmc, or high bitrate matrix
do use bframes and vbv
Sharktooth
4th May 2005, 11:04
do NOT use b-frames and dont use wmv.
jthunder
4th May 2005, 22:55
I wanted to try to keep the resolution to 1280x720 for maximum quality (and maintain the 16:9 ratio for the source).
So should I do full processing, a fast reencode or normal reencode using virtualdub?
what is the verdict on bframes and the matrix settings?
Thanks
Sharktooth
5th May 2005, 00:11
fast processing mode ensures a faster and better quality encoding. it doesnt affect decoding at all.
b-frames add decoding complexity and turning them off should speed up the decoding process.
matrices affect the quantization process so, in theory, they should interfere with decoding speed.
Emp3r0r
5th May 2005, 05:21
do NOT use b-frames and dont use wmv.who said anything about wmv? this xvid forum :rolleyes:fast processing mode ensures a faster and better quality encoding this isn't true
jthunder
5th May 2005, 05:29
Basically I'm looking for a 'basic' guide to get the maximum amount of quality for a 1280x720 file, at the lowest decoding effort and the resulting size of the file is also not an issue (lots of hd space).
Can you guys suggest quick and dirty steps using virtualdub that would get me where I want to go?
Thanks again.
Emp3r0r
5th May 2005, 05:31
in my tests, the quality was actually higher using a smaller resolution because the higher resolution was too much for the xbox to handle. therefore to get the higher resolution to work you have to drop the bitrate which resulted in less quality overall.
btw: my tests are all done over the network. I found that playing off the harddrive will reduce the number of dropped frames during high bitrate scenes.
jthunder
5th May 2005, 06:38
Is there anyway to optimize the codec so that on the high bitrate scenes the quality is reduced slightly to lower the bitrate temporarily, then when the scene is less intesive, the quality is raised?
In your experience what should I set the bitrate setting to, to get the highest quality vs lowest bitrate at 720?
thanks
communist
5th May 2005, 13:41
I think VBV does prevent XviD from using more bits than 'allowed'. However the values for it are defined for each Profile / Level and I dont think you can change it as in some MPEG1/2 Encoders. If bitrate (and not the big resolution / cpu requirement for it) is really your problem then try the latest beta with VBV enabled and check which profiles gives you the most optimal trade-off.
Sharktooth
5th May 2005, 13:57
Originally posted by Emp3r0r
this isn't true
No? and why? Maybe you should search a bit...
Originally posted by jthunder
Is there anyway to optimize the codec so that on the high bitrate scenes the quality is reduced slightly to lower the bitrate temporarily, then when the scene is less intesive, the quality is raised? yes, xvid has it. it's called curve compression. u'll find it on the 2nd pass setup panel (lower part)
the bests
y
jthunder
5th May 2005, 16:17
Thanks I'll post back to this thread once I've run through encodes to see how it looks and the performance on the xbox hardware.
JT
Emp3r0r
12th May 2005, 03:40
Originally posted by Sharktooth
No? and why? As far as I know, fast processing mode just speeds up the first pass by taking a bunch of shortcuts. On the other hand, a full quality first pass should increase quality as it takes no shortcuts on the firstpass and the curve scaling should be more accurate for the second pass. However, the longer encoding time usually isn't worth the small boost in quality.
Sharktooth, if you know differently, by all means share what you know or at least provide a link that explains fast processing increases quality.
Blue_MiSfit
12th May 2005, 07:11
I think he is referring to the fast processing option in virtual dub. If I am correctly decoding Sharktooth's brainwaves - he means that forcing "fast recompress" keeps the video in yv12 through the whole encoding process - no color conversions.
Not that this would really impact decoding, since xvid uses yv12 colorspace anyway. Hmm now that I think about it I may not have a clue as to what Sharktooth means :) share it with us! :D
-MiSfit
communist
12th May 2005, 08:18
from virtualdub.org
How do I best speed up compression?
There is only one tip I can give: try enabling "fast repack." When this is enabled, VirtualDub attempts to negotiate a fast YUV or YCrCb path between the video decompression and compression codecs. Both input and output video streams must be compressed, and you can get weird artifacts or flipped video with buggy codecs -- do not use it if Indeo Video R3.2 or Radius Cinepak are involved. This option will also disable all video filters, however, so it's mainly only useful for transcoding. It's not unusual to see overall frame rates increase by 20% when using fast repack.
Fast repack cannot be used with Ben's original versions of Avisynth, because they only output RGB data. Others have since released updated versions of Avisynth that can output YUY2 as well, and these will work in fast repack.
That is fast recompress in newer versions. That will make VDub directly give YV12 data that you feed it via AviSynth (for ex.) to the encoder - so no quality & speed loss due to color space conversions.
Sharktooth
12th May 2005, 14:15
Sorry i meant Fast Recompress in Vdub.
jthunder
20th May 2005, 19:04
Good news! it worked.
Fast recompress/single pass/xvid/unrestricted profile/no options selected/~4000Kbps
Now any of the 720p files that I had (wmv, divx, xvid) will playback smoothly using xbmc. I have noticed some quality compromises in some of the fast moving scenes, but in the slow detailed scenes it looks great. Although I have to admit that I don't really have that much to compare it to, but I do know that it looks better than the original DVD/MPEG2 480p source.
Thanks for the help guys, when I have some time I'm going to play around with a few of the options to see if I can get it any better. If you have any suggestions or experience with what settings I could change for quality vs bitrate I'd like to know.
JT
Sharktooth
20th May 2005, 19:26
a 2 passes encode with the same settings will give you a better quality during high motion, but it will take longer to encode.
jthunder
20th May 2005, 23:02
Are there any special settings for 2-pass that I should worry about?
communist
20th May 2005, 23:22
You can (or 'should') use all tools available that wont make a difference to the decoder (like Chroma Motion / Trellis / AQ / VHQ) but will slow down the encoding. Other things like B-frames and QPEL / GMC will also require additional processing power at the decoder side beside slowing down your encoding speed even more.
Some people prefer AQ (etc.) - some not - just make a few sample encodes and see if you like their effect on the quality.
For explanations on the tools take a look at the FAQ http://ronald.vslcatena.nl/docs/xvidfaq.html.
Bathrone
22nd May 2005, 09:39
Ive done testing with Divx and XBMC
I found it to handle Divx's 1 warp point GMC just fine. Also the multiple adapative b frames was fine. Since I encode in slow mode, the quarter pixel gets disabled by the encoder anyway.....Testing qpel is faster encode modes it worked fine.In short, with the latest Divx version (not fusion however) I could not give XBMC any curry and I never lost any frames or had artificating with the way I encoded it. Use GMC, B frames, qpel, it all works.
Im now about to try some tests with Xvid on XBMC - Ill report the results.
jthunder
24th May 2005, 16:24
Edit - I'd like to keep discussion for this on the HD resolution that the xbox hardware is *just* capable of processing) - Edit
Bathrone, just to be sure we are still talking about 1280x720 resolution source right? I am very interested in your testing, please post back when you have something to report.
Thanks
JT
Sharktooth
24th May 2005, 17:38
No, he's not considering HD res.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.