View Full Version : Why is XviD playback very jerky?


TNM
12th March 2003, 09:36
I encoded a mpeg2 clip using 2 pass XviD (XviD-4102002-1) at around 3000kbps. The playback was very jerky but when I changed the 4CC of the clip to DIVX, the playback was very smooth. Why is it? I didn't check any box in the XviD decoder and the DivX decoder postprocessing was set to half. I running on a P3 800mhz laptop...

mf
12th March 2003, 09:42
Maybe using ffdshow to decode may speed it up ?

TNM
12th March 2003, 09:56
@mf

I don't like hybrid decoder like ffdshow. I prefer to install codecs seperately ;)

@XviD developer

I don't mean to offence but is it right that XviD decoder is not as efficient as DivX decoder?

mf
12th March 2003, 11:00
Originally posted by TNM
I don't like hybrid decoder like ffdshow. I prefer to install codecs seperately ;)
I don't mean to offence but is it right that XviD decoder is not as efficient as DivX decoder?
"Hybrid decoder" ? There's nothing "hybrid" about ffdshow. It's just an implementation of libavcodec which happens to be able to decode both DivX and XviD. So that's why it gives you the option of decoding both. Nothing hybrid about it really. Anyway, libavcodec is heavily optimized and is usually much faster even than DivX. There's a big possibility that XviD is slow, for various reasons. And I don't acknowledge your point of why you're not using ffdshow. If you want it faster, use that. Or use DivX's nice decoder and don't complain about it.

TNM
12th March 2003, 12:14
Originally posted by mf
"Hybrid decoder" ? There's nothing "hybrid" about ffdshow. It's just an implementation of libavcodec which happens to be able to decode both DivX and XviD. So that's why it gives you the option of decoding both. Nothing hybrid about it really. Anyway, libavcodec is heavily optimized and is usually much faster even than DivX. There's a big possibility that XviD is slow, for various reasons. And I don't acknowledge your point of why you're not using ffdshow. If you want it faster, use that. Or use DivX's nice decoder and don't complain about it.
No, no, I don't complain :D I just want to find out a way how to use the internal XviD decoder to playback my high bitrate XviD encodes smoothly coz it's troublesome for me to change the 4CC everytime after encoding ;D

Thanks for your suggestion about ffdshow, I'll give it a try sometimes :)

Trahald
12th March 2003, 15:34
all i use is ffdshow. works fine for me. i have had different speed cpus and havent really noticed a difference between speed of decoding when i do use the xvid decoder (meaning no skipping). but since i end up reseting up my system every few months i like just being able to install ffdshow and being able to play everything

AS
12th March 2003, 15:55
Xvid's decoder is a much more stronger post-processer than ffdshow and hence it requires higher demands for cpu

mf
12th March 2003, 21:33
Originally posted by AS
Xvid's decoder is a much more stronger post-processer than ffdshow and hence it requires higher demands for cpu
s/stronger/smarter/ :)

It seems ffdshow's deblocking is little more than a strong blur on macroblock edges, where XviD's (Nic's) seems to do real edge detection or something (to illustrate: when there are stars in picture, some of which happen to be on macroblock edges, they'll be blurred like crazy in ffdshow. XviD's postprocessor keeps them intact). However, ffdshow's deringing is more powerful :).

Semi-Offtopic: why does ffdshow have an option for "Nic's postprocessing", while it behaves totally different from the one found in Nic's xvid.ax ? I'd really like some proper deblocking in ffdshow.

APF_Gandalf
12th March 2003, 23:41
this reminds me the first time I used B-frames without checking DX50 B-vop compatibility in one of my encodes in later november, but since it was only a test and I never used B-frames in Xvid for my real encodes, I don't know if checking this box is necessary with more recent builds.
maybe the search button of this forum will help you more about this B-frame thing if you used B-frames in your encode.

TNM
13th March 2003, 04:15
I encoded using a stable build so all settings about b-frames are grayed out...My graphic card is a Geforce2 with 16mb ddr ram so i think it shouldn't be a problem :) Guess it's slow because of my lousy P3 800mhz :(

I solved the problem by choosing 4CC DIVX everytime I encode and let DivX decoder decode all of my XviD contain. Everything is fine now. Thanks for all the suggestions :p

PS: I have a question about ffdshow though. I installed it and thought that it could decode all divx5 contain so i uninstalled divx5 .After that I could watch divx5 movies with ffdshow fine but I couldn't open divx5 movie in Vdubmod anymore, it said that divx5 is required :confused: So does that mean ffshow can only allow me to "watch" divx5 contain but cannot let other apps like vdub "open" divx5 movies ?

AS
13th March 2003, 11:41
That's because media players normally(?) opens videos using DS filters and therefore can use ffdshow to decode. Virtualdub, however, calls for the actual codec in the encode and hence it requires divx 5 to decode the video.

cult
13th March 2003, 14:47
ffdshow is just a decoder.Vd needs the encoder,that means divx 5 itself to be installed in your system

TNM
14th March 2003, 13:14
oh i see i see. so i have no choice but to install all divx5, xvid and ffdshow then :D

mf
14th March 2003, 13:18
Originally posted by TNM
oh i see i see. so i have no choice but to install all divx5, xvid and ffdshow then :D
3ivx vfw can act as a divx5 decoder. But I wouldn't recommend it.

Manao
14th March 2003, 19:03
A PIII 800 MHz is enough to decode XviD. Your problem must be an overlay problem. Can you check which kind of overlay is used when playbacking XviD video with Nic's decoder and with DivX. To do the checking, use BSPlayer, since you can force with it the use of an YV12 overlay. If you can't have the YV12 overlay ( overlay mode 1 in BSPlayer ), it's time to update your video driver ( if it isn't already done ). Choose the detonator 30.82 (or the last one of the 30 serie ), since the 40 serie seems to be a little weird with overlays.

I would also say like the others : FFDShow is generally better in decoding MPEG-4, since you can tweak everything you want.

APF_Gandalf
15th March 2003, 02:30
I never tried, but i guess you can load your .avi into Virtual dub using avisynth even if you only use FFDshow. the Directshowsource() seems to be there for this kind of problem.

Quoted from avisytnh's doc:

" DirectShowSource(string filename, int "fps")

DirectShowSource reads filename using DirectShow, the same multimedia playback system which Windows Media Player uses. It can read most formats which Media Player can play, including MPEG, MP3, and QuickTime, as well as AVI files that AVISource doesn't support (like DV type 1, or files using DirectShow-only codecs). Try reading AVI files with AVISource first, and if that doesn't work then try this filter instead. "

mf
15th March 2003, 11:54
Originally posted by APF_Gandalf
I never tried, but i guess you can load your .avi into Virtual dub using avisynth even if you only use FFDshow. the Directshowsource() seems to be there for this kind of problem.

Quoted from avisytnh's doc:

" DirectShowSource(string filename, int "fps")

DirectShowSource reads filename using DirectShow, the same multimedia playback system which Windows Media Player uses. It can read most formats which Media Player can play, including MPEG, MP3, and QuickTime, as well as AVI files that AVISource doesn't support (like DV type 1, or files using DirectShow-only codecs). Try reading AVI files with AVISource first, and if that doesn't work then try this filter instead. "
Sadly DirectShowSource is hopelessly broken in the latest versions of AviSynth, I've only got it to run once.

TNM
15th March 2003, 13:59
@manao

I'm using BSPlayer and have no problem with both overlay mode 1 and 2 :)

@APF_Gandalf

Your method works but when I want to trim the clip using direct stream copy mode, vdub warns me that direct stream copy an avs script will lead to uncompressed output and filesize will be huge :eek:

cinghio
15th March 2003, 20:53
I've seen different behavior in fullscreen playback.
I'm sure this is not the first time this argument cames out.

My impression using different codec/decoders is:
DivX playback is in someway using hardware stretching functions,
on the contrary XivD and ffdshow do not.

When the playback is done at native resolution no difference.

Can someone give me feedback?

mf
15th March 2003, 22:52
Originally posted by TNM
Your method works but when I want to trim the clip using direct stream copy mode, vdub warns me that direct stream copy an avs script will lead to uncompressed output and filesize will be huge :eek:
Open the AVS, select your range, save it to a notepad window, open the AVI and check "Popup extended open options", look at the FourCC editboxes and remember their values. Then force both FourCCs to "MSVC". Disable "show input video" and "show output video" from the options menu, and select your range. Set direct stream copy and save the AVI. After that, use AviC.exe (http://download.rave-zone.com/utils/avic.exe) to set the resulting AVI's FourCC back to what it was before.