After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769565 - tsdemux: playback is faster than normal speed for certain files
tsdemux: playback is faster than normal speed for certain files
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.8.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-05 20:00 UTC by Nirmal Palanisamy
Modified: 2018-11-03 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Nirmal Palanisamy 2016-08-05 20:00:09 UTC
There are some streams in which PCR is present at interval more than 500ms(say for example 1 sec or 1.5 sec) at few positions. When there is a PCR gap of more than 500ms between last PCR and new PCR, a new PCR group is formed. While forming new PCR group, PCR offset is computed with respect to previous group and stored. But this stored PCR offset is not computed properly. And when this group is referred to compute timestamp for a frame, it is done based on first PCR and PCR offset of this group. Since the PCR offset is wrongly stored when forming the group, time stamp computation also goes wrong. PCR offset stored is little less than the right PCR offset. Because of lesser PCR offset, time stamp computed also lesser than actual. Due to this playback ends very fast than the actual duration. And also because of wrong PCR offset for last group(which set during initial scanning), duration of file computed is less than the actual.
Comment 1 Nirmal Palanisamy 2016-08-05 20:01:28 UTC
With this patch change, above mentioned issue is not observed.

diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c
index a7e0798..787dde8 100644
--- a/gst/mpegtsdemux/mpegtspacketizer.c
+++ b/gst/mpegtsdemux/mpegtspacketizer.c
@@ -1830,11 +1830,6 @@ _set_current_group (MpegTSPCR * pcrtable,
         /* The previous group closed at the raw last_pcr diff (+100ms for safety) */
         pcr_offset += prev->values[prev->last_value].pcr + 100 * PCR_MSECOND;
       }
-    } else if (lastpcr < pcr - 500 * PCR_MSECOND) {
-      GST_WARNING ("GAP detected. diff %" GST_TIME_FORMAT,
-          GST_TIME_ARGS (PCRTIME_TO_GSTTIME (pcr - lastpcr)));
-      /* The previous group closed at the raw last_pcr diff (+500ms for safety) */
-      pcr_offset += prev->values[prev->last_value].pcr + 500 * PCR_MSECOND;
     } else
       /* Normal continuation (contiguous in time) */
       pcr_offset += pcr - prev->first_pcr;
Comment 2 Tim-Philipp Müller 2016-08-06 11:45:10 UTC
If you could attach (parts of) a sample file that might be helpful.
Comment 3 rland 2017-01-03 02:08:28 UTC
This file seems to be able to reproduce the problem.
vlc can not get duration, but can be smooth playback.
gst-play-1.0 every few seconds, there is a sense of jump, and print the following information:
Redistribute latency ...
Redistribute latency ...
Redistribute latency ...
Comment 4 rland 2017-01-03 03:43:37 UTC
Sorry for miss submission.
This file seems to be able to reproduce the problem.
----------
https://drive.google.com/file/d/0B8t5E5lSOxhHRUZYSkpvX0VRdzg/view?usp=sharing
or
http://www.mediafire.com/file/4el4nw4m6jy3v5b/2m.ts
----------
vlc can not get duration, but can be smooth playback.
gst-play-1.0 every few seconds, there is a sense of jump, and print the following information:
Redistribute latency ...
Redistribute latency ...
Redistribute latency ...
0:00:05.9 / 0:09:05.3    
0:00:06.0 / 0:09:18.2    
0:00:07.5 / 0:08:19.9    
0:00:07.8 / 0:08:19.9    
0:00:07.9 / 0:08:19.9    
0:00:10.3 / 0:06:59.6    
0:00:13.2 / 0:05:39.6    
0:00:13.2 / 0:05:40.7    
0:00:16.2 / 0:05:21.9    
0:00:16.9 / 0:05:33.9
Comment 5 GStreamer system administrator 2018-11-03 13:54:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/415.