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 161262 - [mpegdemux] cannot play a pes mpeg file
[mpegdemux] cannot play a pes mpeg file
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: 0.8.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 138435 152403
 
 
Reported: 2004-12-14 12:43 UTC by Zaheer Abbas Merali
Modified: 2005-02-08 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
recording.mpg.txt (28.24 KB, text/plain)
2004-12-15 10:31 UTC, Zaheer Abbas Merali
Details

Description Zaheer Abbas Merali 2004-12-14 12:43:14 UTC
it doesnt detect in typefind either, but plays in mplayer.

gst-launch-0.8 -v filesrc location=/tmp/recording.mpg ! mpegdemux name=demux
{demux.video_00 ! queue ! mpeg2dec ! ffmpegcolorspace ! xvimagesink } seems to
negotiate but nothing comes on screen, window gets sized to the correct
resolution tho.
Comment 1 Zaheer Abbas Merali 2004-12-14 12:45:34 UTC
file is at http://zaheer.merali.org/random/recording.mpg
Comment 2 Zaheer Abbas Merali 2004-12-14 16:11:22 UTC
I'm modifying the system stream typefind to find it, as thats easy
Comment 3 Zaheer Abbas Merali 2004-12-14 16:27:09 UTC
Here is the patch to make it found by typefind:

diff -u -r1.61 gsttypefindfunctions.c
--- gsttypefindfunctions.c      25 Nov 2004 20:14:32 -0000      1.61
+++ gsttypefindfunctions.c      14 Dec 2004 16:25:09 -0000
@@ -544,6 +544,13 @@
                                         (((guint8 *)data)[1] == 0x00) &&      \
                                        (((guint8 *)data)[2] == 0x01) &&      \
                                        ((((guint8 *)data)[3] & 0x80) == 0x80))
+#define IS_MPEG_PES_HEADER(data)        ((((guint8 *)data)[0] == 0x00) &&     \
+                                        (((guint8 *)data)[1] == 0x00) &&      \
+                                        (((guint8 *)data)[2] == 0x01) && \
+                                        ((((guint8 *)data)[3] == 0xE0) || \
+                                         (((guint8 *)data)[3] == 0xC0) || \
+                                         (((guint8 *)data)[3] == 0xBD)))
+
 static void
 mpeg2_sys_type_find (GstTypeFind * tf, gpointer unused)
 {
@@ -566,6 +573,15 @@
       gst_caps_free (caps);
     }
   }
+  else if (data && IS_MPEG_PES_HEADER (data)) {
+    /* PES stream */
+    GstCaps *caps = gst_caps_copy (MPEG_SYS_CAPS);
+
+    gst_structure_set (gst_caps_get_structure (caps, 0), "mpegversion",
+        G_TYPE_INT, 2, 0);
+    gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, caps);
+  }
+
 };

 /* ATTANTION: ugly return value:
Comment 4 Zaheer Abbas Merali 2004-12-14 16:38:13 UTC
patch committed

Currently playing of the file makes xvimagesink wait until a set time (for ages)
before it starts.  I am looking into mpegdemux to debug it.
Comment 5 Zaheer Abbas Merali 2004-12-15 09:06:38 UTC
http://www.codeproject.com/csharp/Program_Stream_Analyzer.asp

has a nice diagram showing the layout of mpeg2 pes packets and has a C#
(WindowsForms) prog to output info about a pes file to stdout
Comment 6 Zaheer Abbas Merali 2004-12-15 10:31:09 UTC
Created attachment 34854 [details]
recording.mpg.txt

I rejigged the C# program on that page to not have the gui and just do the pes
dump to text file for the first argument.
Comment 7 Ronald Bultje 2005-02-08 16:28:12 UTC
totem plays this fine in current CVS... Probably thanks to Jan's fixes.