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.
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.