Timestamp issue with audio/video playback when using mpegtsdemux

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

Timestamp issue with audio/video playback when using mpegtsdemux

krupa
Hi,

I'm using the following pipeline
gst-launch-0.10 filesrc location=test2.ts ! video/mpegts ! mpegtsdemux name=demux demux. ! queue max-size-buffers=0 max-size-time=0 ! decodebin  ! ffmpegcolorspace ! ximagesink demux. ! queue max-size-buffers=0 max-size-time=0 ! dvdlpcmdec ! alsasink

I have one test1.ts in which PTS values for each for the audio and video packets are set and another test2.ts where some of the video packets(almost alternating) don't have PTS values set. The pipeline works for test1.ts but doesn't work for test2.ts. When running test2.ts, the screen just displays one video frame and just hangs and I'm not able to hear any audio.

If I use filesink instead of audio and video sinks, its able to dump both audio and video and I'm able to decode them later and play them out separately.

If for the same pipeline I add sync=false at both the audio and video sinks, both audio and video are able to play out but are not in sync with each other.

When PTS value is not there in the packet, mpegtsdemux sets,

time = GST_CLOCK_TIME_NONE;
GST_BUFFER_TIMESTAMP(buffer) = time;

before doing the gst_pad_push of the buffer.

Is this setting of GST_BUFFER_TIMESTAMP to GST_CLOCK_TIME_NONE causing the problem? How should the timestamp be handled when PTS value is not set in the packet?
Reply | Threaded
Open this post in threaded view
|

Re: Timestamp issue with audio/video playback when using mpegtsdemux

Edward Hervey
Hi,

  You want to try again with 1.x. I have some sample files which have
PTS set on only some video frames (keyframes for example) and it plays
fine.
  GST_CLOCK_TIME_NONE is gstreamer's way of stating that there are no
PTS (and then it's up to downstream parser/decoder to fill in the blanks
if it can).

   Edward

On Tue, 2013-08-06 at 07:30 -0700, krupa wrote:

> Hi,
>
> I'm using the following pipeline
> gst-launch-0.10 filesrc location=test2.ts ! video/mpegts ! mpegtsdemux
> name=demux demux. ! queue max-size-buffers=0 max-size-time=0 ! decodebin  !
> ffmpegcolorspace ! ximagesink demux. ! queue max-size-buffers=0
> max-size-time=0 ! dvdlpcmdec ! alsasink
>
> I have one test1.ts in which PTS values for each for the audio and video
> packets are set and another test2.ts where some of the video packets(almost
> alternating) don't have PTS values set. The pipeline works for test1.ts but
> doesn't work for test2.ts. When running test2.ts, the screen just displays
> one video frame and just hangs and I'm not able to hear any audio.
>
> If I use filesink instead of audio and video sinks, its able to dump both
> audio and video and I'm able to decode them later and play them out
> separately.
>
> If for the same pipeline I add sync=false at both the audio and video sinks,
> both audio and video are able to play out but are not in sync with each
> other.
>
> When PTS value is not there in the packet, mpegtsdemux sets,
>
> time = GST_CLOCK_TIME_NONE;
> GST_BUFFER_TIMESTAMP(buffer) = time;
>
> before doing the gst_pad_push of the buffer.
>
> Is this setting of GST_BUFFER_TIMESTAMP to GST_CLOCK_TIME_NONE causing the
> problem? How should the timestamp be handled when PTS value is not set in
> the packet?
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Timestamp-issue-with-audio-video-playback-when-using-mpegtsdemux-tp4661457.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Timestamp issue with audio/video playback when using mpegtsdemux

krupa
Hi,

I did try with gstreamer-1.0 but the issue still exists.

I'm attaching the timestamp log of audio and video (filter->pts print values in function gst_mpegts_demux_data_cb in gstmpegtsdemux.c).

filter->pts value is used to calculate the time:
pts = filter->pts;
time = MPEGTIME_TO_GSTTIME (pts) + stream->base_time;

I was not able to correlate between this time and actual play time.

Regards,
Krupa
timestamp_log
Reply | Threaded
Open this post in threaded view
|

Re: Timestamp issue with audio/video playback when using mpegtsdemux

Edward Hervey
Hi,

  Please file a bug and attach the failing file (or a link to it if it's
too big to put in bugzilla).

    Edward

On Mon, 2013-08-19 at 07:01 -0700, krupa wrote:

> Hi,
>
> I did try with gstreamer-1.0 but the issue still exists.
>
> I'm attaching the timestamp log of audio and video (filter->pts print values
> in function gst_mpegts_demux_data_cb in gstmpegtsdemux.c).
>
> filter->pts value is used to calculate the time:
> pts = filter->pts;
> time = MPEGTIME_TO_GSTTIME (pts) + stream->base_time;
>
> I was not able to correlate between this time and actual play time.
>
> Regards,
> Krupa
> timestamp_log
> <http://gstreamer-devel.966125.n4.nabble.com/file/n4661603/timestamp_log>  
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Timestamp-issue-with-audio-video-playback-when-using-mpegtsdemux-tp4661457p4661603.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel