@@ -33,7 +33,7 @@ public function Analyze() {
3333
3434 if (substr ($ IVFheader , 0 , 4 ) == 'DKIF ' ) {
3535
36- // https://wiki.multimedia.cx/index.php/IVF
36+ // https://wiki.multimedia.cx/index.php/Duck_IVF
3737 $ info ['ivf ' ]['header ' ]['signature ' ] = substr ($ IVFheader , 0 , 4 );
3838 $ info ['ivf ' ]['header ' ]['version ' ] = getid3_lib::LittleEndian2Int (substr ($ IVFheader , 4 , 2 )); // should be 0
3939 $ info ['ivf ' ]['header ' ]['headersize ' ] = getid3_lib::LittleEndian2Int (substr ($ IVFheader , 6 , 2 ));
@@ -51,10 +51,6 @@ public function Analyze() {
5151 $ this ->warning ('Expecting IVF header version 0, found version ' .$ info ['ivf ' ]['header ' ]['version ' ].', results may not be accurate ' );
5252 }
5353
54- $ info ['video ' ]['resolution_x ' ] = $ info ['ivf ' ]['header ' ]['resolution_x ' ];
55- $ info ['video ' ]['resolution_y ' ] = $ info ['ivf ' ]['header ' ]['resolution_y ' ];
56- $ info ['video ' ]['codec ' ] = $ info ['ivf ' ]['header ' ]['fourcc ' ];
57-
5854 $ info ['ivf ' ]['frame_count ' ] = 0 ;
5955 $ timestamp = 0 ;
6056 while (!$ this ->feof ()) {
@@ -65,9 +61,17 @@ public function Analyze() {
6561 $ info ['ivf ' ]['frame_count ' ]++;
6662 }
6763 }
68- if ($ info ['ivf ' ]['frame_count ' ] && $ info ['playtime_seconds ' ]) {
69- $ info ['playtime_seconds ' ] = $ timestamp / 100000 ;
70- $ info ['video ' ]['frame_rate ' ] = (float ) $ info ['ivf ' ]['frame_count ' ] / $ info ['playtime_seconds ' ];
64+ //if ($info['ivf']['frame_count'] && $timestamp) {
65+ // $info['playtime_seconds'] = $timestamp / 100000;
66+ // $info['video']['frame_rate'] = (float) $info['ivf']['frame_count'] / $info['playtime_seconds'];
67+ //}
68+
69+ $ info ['video ' ]['resolution_x ' ] = $ info ['ivf ' ]['header ' ]['resolution_x ' ];
70+ $ info ['video ' ]['resolution_y ' ] = $ info ['ivf ' ]['header ' ]['resolution_y ' ];
71+ $ info ['video ' ]['fourcc ' ] = $ info ['ivf ' ]['header ' ]['fourcc ' ];
72+ if ($ info ['ivf ' ]['header ' ]['frame_count ' ] && $ info ['ivf ' ]['header ' ]['frame_rate ' ]) {
73+ $ info ['video ' ]['frame_rate ' ] = (float ) $ info ['ivf ' ]['header ' ]['frame_rate ' ];
74+ $ info ['playtime_seconds ' ] = (float ) $ info ['ivf ' ]['frame_count ' ] / $ info ['ivf ' ]['header ' ]['frame_rate ' ];
7175 }
7276
7377 } else {
0 commit comments