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 726117 - typefinding: issue in MPEG-TS detection logic for streams with Null Pids
typefinding: issue in MPEG-TS detection logic for streams with Null Pids
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-11 16:34 UTC by Pankaj
Modified: 2015-10-01 11:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to correct MPEG-TS detection logic in Typefind (1.07 KB, patch)
2014-03-11 16:34 UTC, Pankaj
committed Details | Review
Attaching the sample file with Null PID packets (800.00 KB, video/vnd.dlna.mpeg-tts)
2014-03-13 14:53 UTC, Pankaj
  Details

Description Pankaj 2014-03-11 16:34:16 UTC
Created attachment 271535 [details] [review]
Patch to correct MPEG-TS detection logic in Typefind

The current TS detection logic in Typefind checks for the adaptation control field to be Non-Null to declare the TS as valid TS.
However, there are TS files where adaptation control field is 0 for the packets with NULL pids.

To resolve this an additional condition is needed that, if adapation control field is 0 and PID is NULL, then declare as a valid TS stream.

Attaching the patch that is based on above suggestion.
Comment 1 Tim-Philipp Müller 2014-03-11 23:17:27 UTC
Thanks for the patch. Could you make a small (< 1MB) sample of such an MPEG-TS stream available by any chance and attach it to this bug report?

You can create one with:

  $ head --bytes=800k foo.ts > sample.ts
Comment 2 Pankaj 2014-03-13 14:53:24 UTC
Created attachment 271727 [details]
Attaching the sample file with Null PID packets

Attaching the sample file with Null PID packets.
Comment 3 Tim-Philipp Müller 2014-03-13 23:18:52 UTC
Thank you.
Comment 4 Reynaldo H. Verdejo Pinochet 2014-04-04 23:17:33 UTC
Review of attachment 271535 [details] [review]:

Thanks for your patch and the sample. I couldn't find any
reference to this field being 00 for valid streams though.
00 seems to be reserved. Can you provide more info on the
rationale behind it? Regarding the patch, just two nits:

::: gst-plugins-base-0.10.34-orig/gst/typefind/gsttypefindfunctions.c
@@ +1938,3 @@
 #define MPEGTS_HDR_SIZE 4
 /* Check for sync byte, error_indicator == 0 and packet has payload */
+/* Adaptation control filed (((data)[3] & 0x30) == 0x00) may be zero for TS packets with NULL PIDs.

filed/field

@@ +1939,3 @@
 /* Check for sync byte, error_indicator == 0 and packet has payload */
+/* Adaptation control filed (((data)[3] & 0x30) == 0x00) may be zero for TS packets with NULL PIDs.
+     Still these streams are valid TS streams */

Still,
Comment 5 Tim-Philipp Müller 2015-10-01 11:53:43 UTC
commit eaf4ce01d3be395ef88230f81382caaa0e678712
Author: Pankaj Darak <pankajdarak@gmail.com>
Date:   Thu Oct 1 12:32:33 2015 +0100

    typefinding: mpeg-ts detection improvement
    
    Allow AFC to be 0 for null pid packets.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726117