Reimar Döffinger <[email protected]> added the comment:

On Fri, Oct 29, 2010 at 02:22:34PM +0000, Carl Eugen Hoyos wrote:
> Sample file and DirectShow filter installer uploaded to
> /samples/ffmpeg-bugs/roundup/issue2333
> 
> The first eight bytes of the file read "00 00 01 c6 4d 50 47 34" (....MPG4),
> this seems to be the only readable string in the file.

This file uses NAL units with an invalid bit set for custom data, and
this custom data
1) appears in-between slices
2) apart from the invalid bit and one 00 too few looks mostly like SPS

As a quick hack, below patch "fixes" most error messages when
treating it like a "normal" H.264 stream.
Of course a proper demuxer that makes use of the extra data is
the proper solution.
Index: libavcodec/h264_parser.c
===================================================================
--- libavcodec/h264_parser.c    (revision 25603)
+++ libavcodec/h264_parser.c    (working copy)
@@ -69,7 +69,7 @@
             else if(buf[i]) state = 7;
             else            state>>=1; //2->1, 1->0, 0->0
         }else if(state<=5){
-            int v= buf[i] & 0x1F;
+            int v= buf[i] & 0x9F;
             if(v==6 || v==7 || v==8 || v==9){
                 if(pc->frame_start_found){
                     i++;
Index: libavcodec/h264.c
===================================================================
--- libavcodec/h264.c   (revision 25603)
+++ libavcodec/h264.c   (working copy)
@@ -2837,6 +2837,8 @@
         if(  (s->hurry_up == 1 && h->nal_ref_idc  == 0) //FIXME do not discard 
SEI id
            ||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc  == 0))
             continue;
+        if (hx->nal_ref_idc & 4) // invalid
+            continue;

       again:
         err = 0;

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2333>
________________________________________________

Reply via email to