[Live-devel] buggy MPEG4 ES?

Maxim Petrov max at code-it-now.com
Fri Oct 6 04:57:43 PDT 2006


Levente Kovacs wrote:

>On Fri, 06 Oct 2006 12:10:37 +0300
>Maxim Petrov <max at code-it-now.com> wrote:
>
>  
>
>>I have example of MPEG4 ES file (http://82.207.113.45/test.m4v) which 
>>could not be correct parsed by "MPEG4VideoStreamParser"
>>I invesigated that in that stream "VIDEO_OBJECT_LAYER" code appears 
>>(randomly) after VOP and before next VOP.
>>I'm not sure if that's buggy stream or not, but ffmpeg decodes that 
>>stream without complains.
>>Could you please look at that file?
>>    
>>
>
>>From what source did you capture thi file? I think this is not randomly, but after P_VOP before the first I_VOP in a new GVOP. Just an idea, did not looked in to the file.
>  
>
Sorry, my previous message was in HTML.. Replying again.

Stream like that send MangoDSP devices.. not sure about what's model was 
sending exactly that stream.
Yes, seems you are right.. VOL does not appear randomly, just before 
next I_VOP.

It looks like:

parsing VisualObjectSequence
profile_and_level_indication: 03
parsing VisualObject
visual_object_type: 0x1
saw a video_object_start_code: 0x00000101
parsing VideoObjectLayer
vop_time_increment_resolution: 30
fixed_vop_time_increment: 1
fixed_vop_rate: 1; 'frame' (really tick) rate: 30.000000
parsing GroupOfVideoObjectPlane
time_code: 0x00040, hours 0, minutes 0, marker_bit 1, seconds 0

#parsing VideoObjectPlane
vop_coding_type: 0(I), modulo_time_base: 0, vop_time_increment: 0
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 1
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 2
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 3
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 4
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 5
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 6
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 7
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 8
#parsing VideoObjectPlane
vop_coding_type: 1(P), modulo_time_base: 0, vop_time_increment: 9
MPEG4VideoStreamParser::parseVideoObjectPlane(): Saw unexpected code 
0x120   <---- VOL start code here
                                                                         
                                                    But liveMedia thinks 
that's VOP
#parsing VideoObjectPlane
MPEG4VideoStreamParser::parseVideoObjectPlane(): marker bit not set!
vop_coding_type: 0(I), modulo_time_base: 0, vop_time_increment: 1
#parsing VideoObjectPlane
vop_coding_type: 0(I), modulo_time_base: 0, vop_time_increment: 10
....

I've added little path to MPEG4VideoStreamFramer.cpp:

@@ -634,7 +634,15 @@
   default: {
     if (isVideoObjectStartCode(next4Bytes)) {
       setParseState(PARSING_VIDEO_OBJECT_LAYER);
-    } else {
+    } else if (isVideoObjectLayerStartCode(next4Bytes)){
+      // copy all bytes that we see, up until we reach a VOP_START_CODE:
+      u_int32_t next4Bytes = get4Bytes();
+      while (next4Bytes != VOP_START_CODE) {
+            saveToNextCode(next4Bytes);
+      }
+      setParseState(PARSING_VIDEO_OBJECT_PLANE);
+    } else
+    {
       usingSource()->envir() << 
"MPEG4VideoStreamParser::parseVideoObjectPlane(): Saw unexpected code "
                             << (void*)next4Bytes << "\n";
       setParseState(PARSING_VIDEO_OBJECT_PLANE); // the safest way to 
recover...

Works fine for me. But not sure if it will work fine for other streams.

-- 
Bye, Maxim.



More information about the live-devel mailing list