[FFmpeg-devel] [PATCH] lavf/mpeg: Fix parsing of SageTV recordings

Andrew Gallatin gallatin at gmail.com
Wed Jan 16 20:27:10 CET 2013


I apologize for re-sending this.  I had thought the list server added
the [FFmpeg-devel] subject tags.  It appears I was wrong..

I have a SageTV Linux system.  It produces mpeg2 recordings from
HDHomerun tuners which are not parsed correctly by ffmpeg because
ffmpeg does not find the video stream.  It looks like the heuristic
used by mpegps_read_packet() does not work for these files.
Specifically, "es_type" for the video stream from these recordings is
0x80, rather than STREAM_TYPE_VIDEO_MPEG2.  If I change
mpegps_read_packet()  to rely on the "startcode" path and request a
probe for these streams, then everything works as normal.

I have opened a ticket for this
(https://ffmpeg.org/trac/ffmpeg/ticket/2147), but it said to send the
patch here.  So I have attached my patch.

Before patch:
% ffmpeg -i sample.mpg | & grep Stream
    Stream #0.0[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
    Stream #0.1[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 384 kb/s

After patch:

% ./ffmpeg -i sample.mpg |& grep Stream
    Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:1[0x81]: Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s
    Stream #0:2[0x1e0]: Video: mpeg2video (Main), yuv420p, 1920x1080
[SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc

Thanks & sorry again for being such a newb,

Drew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sagetv.diff
Type: application/octet-stream
Size: 931 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130116/e8b9886d/attachment.obj>


More information about the ffmpeg-devel mailing list