Directshow sync issues

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Directshow sync issues

KEVIN WEST
I am running into a strange issue with a few videos and dshowdecwrapper.  Basically I will transcode the video, but the output is all wrong.  If you open the video, it will show the first frame while playing the entire audio stream, and finally it will play the video stream once it hits the end of the audio.  I thought there may be some synchronization issues since dshow may not be using the same clock as gstreamer, so I implemented an IReferenceClock that calls into the gstreamer clock, however this doesn't seem to be fixing the issue.

For reference, here is my current pipeline:

gst-launch.exe -v --seek=0 uridecodebin name=dec uri="test.wmv" dec. ! videoscale ! videorate ! video/x-raw-yuv, width=320, height=240, framerate=24000/1001 ! ffmpegcolorspace ! x264enc ! queue2 max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. dec. ! audioconvert ! audioresample ! audio/x-raw-int, rate=44100, channels=2 ! faac bitrate=128000 ! queue2 max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. flvmux name=mux ! filesink location="output.flv"

Any ideas what might be going on?
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Directshow sync issues

praveen pandey-2
are you able to play video alone?

BR,
Praveen Pandey

On Sat, Jan 15, 2011 at 8:50 AM, KEVIN WEST <[hidden email]> wrote:
I am running into a strange issue with a few videos and dshowdecwrapper.  Basically I will transcode the video, but the output is all wrong.  If you open the video, it will show the first frame while playing the entire audio stream, and finally it will play the video stream once it hits the end of the audio.  I thought there may be some synchronization issues since dshow may not be using the same clock as gstreamer, so I implemented an IReferenceClock that calls into the gstreamer clock, however this doesn't seem to be fixing the issue.

For reference, here is my current pipeline:

gst-launch.exe -v --seek=0 uridecodebin name=dec uri="test.wmv" dec. ! videoscale ! videorate ! video/x-raw-yuv, width=320, height=240, framerate=24000/1001 ! ffmpegcolorspace ! x264enc ! queue2 max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. dec. ! audioconvert ! audioresample ! audio/x-raw-int, rate=44100, channels=2 ! faac bitrate=128000 ! queue2 max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. flvmux name=mux ! filesink location="output.flv"

Any ideas what might be going on?
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Directshow sync issues

Tim-Philipp Müller-2
In reply to this post by KEVIN WEST
On Fri, 2011-01-14 at 19:20 -0800, KEVIN WEST wrote:

> I am running into a strange issue with a few videos and
>  dshowdecwrapper.  Basically I will transcode the video, but the output
>  is all wrong.  If you open the video, it will show the first frame
>  while playing the entire audio stream, and finally it will play the
>  video stream once it hits the end of the audio.  I thought there may
>  be some synchronization issues since dshow may not be using the same
>  clock as gstreamer, so I implemented an IReferenceClock that calls
>  into the gstreamer clock, however this doesn't seem to be fixing the
>  issue.

Clocks don't matter much in this kind of pipeline - there's neither a
source nor a sink syncing against the clock. Timestamps on the buffers
(and newsegment events preceding the data flow) carry the timing
information.

> For reference, here is my current pipeline:
>
> gst-launch.exe -v --seek=0 uridecodebin name=dec uri="test.wmv" dec. !
>  videoscale ! videorate ! video/x-raw-yuv, width=320, height=240,
>  framerate=24000/1001 ! ffmpegcolorspace ! x264enc ! queue2
>  max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. dec. !
>  audioconvert ! audioresample ! audio/x-raw-int, rate=44100, channels=2
>  ! faac bitrate=128000 ! queue2 max-size-bytes=0 max-size-time=0
>  max-size-buffers=0 ! mux. flvmux name=mux ! filesink
>  location="output.flv"

Have you tried other muxers?

Have you tried with other decoders? (e.g. gst-ffmpeg based)

Have you tried other encoders?

Does playback alone work?

Where does the --seek option come from? That's not in upstream
gst-launch. Try without it.

(Also: use a normal queue instead of queue2 here).

Cheers
 -Tim



------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Directshow sync issues

David Hoyt
In reply to this post by KEVIN WEST
On Fri, 2011-01-14 at 19:20 -0800, KEVIN WEST wrote:

> I am running into a strange issue with a few videos and  
> dshowdecwrapper.  Basically I will transcode the video, but the output  
> is all wrong.  If you open the video, it will show the first frame  
> while playing the entire audio stream, and finally it will play the  
> video stream once it hits the end of the audio.  I thought there may  
> be some synchronization issues since dshow may not be using the same  
> clock as gstreamer, so I implemented an IReferenceClock that calls  
> into the gstreamer clock, however this doesn't seem to be fixing the  
> issue.

Where did you get the windows build? Was it your own or via ossbuild
(gstreamer winbuilds) or cygwin ports? And what version?



------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Directshow sync issues

KEVIN WEST
> Message: 5
> Date: Sat, 15 Jan 2011 12:01:45 +0000
> From: Tim-Philipp M?ller <[hidden email]>
> Subject: Re: [gst-devel] Directshow sync issues
> To: [hidden email]
> Message-ID: <1295092905.12462.4.camel@zingle>
> Content-Type: text/plain; charset="UTF-8"
>
> On Fri, 2011-01-14 at 19:20 -0800, KEVIN WEST wrote:
>
>> I am running into a strange issue with a few videos and
>> dshowdecwrapper.  Basically I will transcode the video, but the output
>> is all wrong.  If you open the video, it will show the first frame
>> while playing the entire audio stream, and finally it will play the
>> video stream once it hits the end of the audio.  I thought there may
>> be some synchronization issues since dshow may not be using the same
>> clock as gstreamer, so I implemented an IReferenceClock that calls
>> into the gstreamer clock, however this doesn't seem to be fixing the
>> issue.
>
> Clocks don't matter much in this kind of pipeline - there's neither a
> source nor a sink syncing against the clock. Timestamps on the buffers
> (and newsegment events preceding the data flow) carry the timing
> information.

Thanks for the info here Tim.  I wasn't sure it would fix the problem and it's good to know it shouldn't be necessary.

>
>> For reference, here is my current pipeline:
>>
>> gst-launch.exe -v --seek=0 uridecodebin name=dec uri="test.wmv" dec. !
>> videoscale ! videorate ! video/x-raw-yuv, width=320, height=240,
>> framerate=24000/1001 ! ffmpegcolorspace ! x264enc ! queue2
>> max-size-bytes=0 max-size-time=0 max-size-buffers=0 ! mux. dec. !
>> audioconvert ! audioresample ! audio/x-raw-int, rate=44100, channels=2
>> ! faac bitrate=128000 ! queue2 max-size-bytes=0 max-size-time=0
>> max-size-buffers=0 ! mux. flvmux name=mux ! filesink
>> location="output.flv"
>
> Have you tried other muxers?

I have tried avimux, flvmux, and mpegtsmux.  With flvmux I get the playback as I described above playing in Adobe Media Player.  With avi and mpg I get either only sound or no playback in Windows Media Player.

>
> Have you tried with other decoders? (e.g. gst-ffmpeg based)

Are you suggesting using something other than dshowdecwrapper for decoding?  I have one mov file with this synchronization issue (h264 video) when using the dshowdecwrapper, and then when using a separate plugin for decoding it works just fine.  It seems to be related to the wrapper.

>
> Have you tried other encoders?

I have not, just x264.  This only happens for some videos, so I don't suspect the encoder, but I will give it a try and report back.

>
> Does playback alone work?

Yes, playback in Windows Media Player of the original wmv plays fine.

>
> Where does the --seek option come from? That's not in upstream
> gst-launch. Try without it.

Sorry, that's from custom code I have added to gst-launch.  Using the straight ossbuild version produces the same sync issue.

>
> (Also: use a normal queue instead of queue2 here).

Haven't tried this but I'm curious about why this may work.  Shot in the dark or is there more reasoning behind it?  I'll give it a try either way.  Thanks!

>
> Cheers
> -Tim
>

On Jan 15, 2011, at 11:40 AM, David Hoyt wrote:

> On Fri, 2011-01-14 at 19:20 -0800, KEVIN WEST wrote:
>
>> I am running into a strange issue with a few videos and  
>> dshowdecwrapper.  Basically I will transcode the video, but the output  
>> is all wrong.  If you open the video, it will show the first frame  
>> while playing the entire audio stream, and finally it will play the  
>> video stream once it hits the end of the audio.  I thought there may  
>> be some synchronization issues since dshow may not be using the same  
>> clock as gstreamer, so I implemented an IReferenceClock that calls  
>> into the gstreamer clock, however this doesn't seem to be fixing the  
>> issue.
>
> Where did you get the windows build? Was it your own or via ossbuild
> (gstreamer winbuilds) or cygwin ports? And what version?
>
>

As far as the windows build we are using, it's based off of the ossbuild.  We have made some modifications, but I always go back and test using the original dlls as well to make sure it's not something we caused with our changes.  I believe the version is

>
> ------------------------------------------------------------------------------
> Protect Your Site and Customers from Malware Attacks
> Learn about various malware tactics and how to avoid them. Understand
> malware threats, the impact they can have on your business, and how you
> can protect your company and customers by using code signing.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel