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

Michael Niedermayer michaelni
Sun Feb 8 17:42:24 CET 2009

On Sun, Feb 08, 2009 at 04:44:10PM +0100, Ivan Schreter wrote:
> 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...

av_read_frame() returns a frame in the demuxer sense of it, it will returns
2 progressive frames for H263 PB (cant be split even if we wanted).

> 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...

please keep in mind that our ts muxer is not very good currently, i would
suggest you try mpeg-ps rather that one should be better

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090208/b5b7ea8e/attachment.pgp>

More information about the ffmpeg-devel mailing list