GNOME Bugzilla – Bug 161262
[mpegdemux] cannot play a pes mpeg file
Last modified: 2005-02-08 16:28:12 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.
file is at http://zaheer.merali.org/random/recording.mpg
I'm modifying the system stream typefind to find it, as thats easy
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:
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.
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
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.
totem plays this fine in current CVS... Probably thanks to Jan's fixes.