Log in

View Full Version : DirectShowSource bug


numlock
26th April 2005, 15:47
I'm posting this as a possible bug in DirectShowSource after
a discussion with DirectShow experts ina MS forum who tested this.

Just to summarize the problem.

capture video in YUY2 color space ( "capture.avi" ), HuffYUV codec

----------------------
DirectShowSource("capture.avi")
Info()
----------------------

I opened the script in VirtualDub and the color format is incorrect in color space RGB32

But if I use
----------------------
AVISource("capture.avi")
Info()
----------------------

The color space is correctly in YUY2

Here are the findings of the MS people who testd this on their machine:

-------------------------------------------------------------

The problem lies in the internals of AviSynth's
DirectShowSource() plugin.

AviSynth builds its graph by first adding its sink then it
invokes RenderFile() which, however, ends up building a
playback graph with a video renderer (the VMR7, but it
depends on your system) and the CSC instead of connecting
the sink, then AviSynth removes the renderer and connects
its sink but it either does not remove the CSC or does not
re-negotiate the video format.

This is the summary of what the graoh builder does:

- add sink
- add AsyncFileSource
- add AviSplitter
- add AviDecompressor
- failed to connect to sink
- failed to connect VideoRendererDefault
- add ColorSpaceConverter
- failed to connect sink
- add VideoRendererDefault (VR|VMR7)
- finished: sink is not connected

As you can see, DirectShow tries to use the sink first and
only uses the CSC+VRD as a last resort.

Why the sink refuses to accept the YUY2 format offered by
the wrapped HuffYUV is anyone's guess. Also, the log shows
some strange behavior on the part of the AviSynth custom
sink.

Wilbert
26th April 2005, 15:58
I don't get it completely. I think that huffyuv is not decoding your avi since the huffyuv.dll is a VfW codec. So, something else is decoding your video. But, perhaps i'm missing something though :)

1) What is decoding your video?

2) Are you sure the decoder is outputting YUY2?

numlock
26th April 2005, 18:26
Originally posted by Wilbert
I don't get it completely. I think that huffyuv is not decoding your avi since the huffyuv.dll is a VfW codec. So, something else is decoding your video. But, perhaps i'm missing something though :)

1) What is decoding your video?

2) Are you sure the decoder is outputting YUY2?

According to MS guy DirectShow handles HuffYUV as any other VCM codec, that is wrapped in the AVIDecompressor

So yes it is using HUffYUV codec

video
5th May 2005, 11:52
another issue. I have asf files captured with asfrecorder. I concatenated them with SegmentedDirectshowSource(). When i open the avs in vdub, the soundtrack is continous, but video freezes at the end of the first segment. winmediaplayer cannot navigate the recorded asf ifles. what can i do? my avisynth is 2.55.