[FFmpeg-devel] [PATCH] H.264/AVCHD interlaced fixes

Ivan Schreter schreter
Sun Feb 8 16:44:10 CET 2009


Laurent Aimar wrote:
> Hi,
>
> On Sat, Feb 07, 2009, Ivan Schreter wrote:
>   
>> #6: Parsing needed picture parameters for and combining of two fields 
>> belonging to same frame into one buffer. Until now, av_read_frame() 
>> would return two buffers for an interlaced frame coded as two field 
>> pictures, which is against av_read_frame() contract to return a buffer 
>> with whole frame (and thus it breaks applications).
>>     
>  I am not sure how the ffmpeg muxers works (at least for mp4 and ts) but
> they need to know where the AU are (Access Unit) otherwise they cannot
> correctly mux h264.
>  So if av_read_frame is changed from returning 'one AU' to 'one or two AU
> that form a frame', they will probably need some changes (unless av_read_frame
> is not used for remuxing).
>
>   
Hm... Good question.

That means, vcodec copy, anything else would decode & recode the picture 
anyway. But from the API perspective, av_read_frame should return a 
frame, not an AU. Or it has to be documented and all applications 
re-worked to work with H.264...

I tried to re-mux a progressive, frame-based and an interlaced, 
field-based H.264 stream to avi, mov, mpegts and nut. avi and nut work 
without problem. mpegts has some general problems telling the whole time 
about "dts < pcr, TS is invalid", for both sources. Remuxed stream 
obviously misses some frames. Mov doesn't seem to work at all with 
H.264, saying "decode_slice_header error" and a few other messages. So 
there seem to be some general issues with remuxing H.264...

Regards,

Ivan





More information about the ffmpeg-devel mailing list