[Bug 608148] tsdemux: Better handle PCR<=>PTS conversion (big difference, latency, ...)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Aug 17 07:45:37 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=608148

--- Comment #39 from shakin at outlook.com <shakin at outlook.com> ---
(In reply to shakin at outlook.com from comment #36)
> I have a test video
> file(https://drive.google.com/file/d/0B5Qs0jIvnVNTM2xGTlprb3NZTFU/
> view?usp=sharing)
> 
> With ffplay, VLC playback is very smooth,but once with GStreamer there is no
> sound, and not smoothing.
> 
> I guess it should be related to the PCR<=>PTS conversion, but not sure,
> anyone could help confirm it? Because this file is not just an “exception”,
> many use ffmpeg to transcode as ts files have the same problem.

Add information!
I try to dig mpegtspacketizer.c:mpegts_packetizer_pts_to_ts()’ code as follows:
--------
GstClockTime
mpegts_packetizer_pts_to_ts (MpegTSPacketizer2 * packetizer,
    GstClockTime pts, guint16 pcr_pid)
{
  GstClockTime res = GST_CLOCK_TIME_NONE;
  MpegTSPCR *pcrtable;
 .....


 if (refpcr != G_MAXINT64) {
/*************!!!!Modifid here!!!!*************************/
      res = pts;
//    res =
//        pts - PCRTIME_TO_GSTTIME (refpcr) + PCRTIME_TO_GSTTIME
(refpcroffset);
/***********************************************************/    
    }
    else
      GST_WARNING ("No groups, can't calculate timestamp");
  } else
    GST_WARNING ("Not enough information to calculate proper timestamp");

  PACKETIZER_GROUP_UNLOCK (packetizer);

  GST_DEBUG ("Returning timestamp %" GST_TIME_FORMAT " for pts %"
      GST_TIME_FORMAT " pcr_pid:0x%04x", GST_TIME_ARGS (res),
      GST_TIME_ARGS (pts), pcr_pid);
  return res;
}
--------
The above modification is just an attempt not to make a PCR <=> PTS conversion,
while using the original PTS,the result is more smoother playback than before.

Of course, this is just an attempt, i read mpegtspacketizer.c but don't get a
deep understanding,so the real reason still is not clear.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list