[FFmpeg-devel] Support MXF separate fields layout with interlaced j2k

Tomas Härdin tomas.hardin at codemill.se
Tue Mar 19 11:55:40 CET 2013


On Wed, 2013-02-20 at 17:19 +0100, Matthieu Bouron wrote:
> On Sat, Feb 16, 2013 at 05:44:49PM +0100, Matthieu Bouron wrote:
> > On Sat, Feb 16, 2013 at 09:23:05AM -0500, Dave Rice wrote:
> > > On Feb 16, 2013, at 7:52 AM, Matthieu Bouron <matthieu.bouron at gmail.com> wrote:
> > > 
> > > In "CDCI Essence Descriptor", if "Interlace or Progressive layout" (0x320C) is 1, then the encoding is field per field rather than frame per frame,

Be careful here. lavc outputs frames in its MPEG video decoders.

> so for a natural presentation you'd need to suppose both that:
> > > - Height is the height of a field, not a frame
> > 
> > I agree.

Correct.

> > > - Frame rate is field rate

Probably not. It's probably the frame rate as you'd expect. But to be
entirely sure you'd have to consult S377m and S422m.

> > Is this behaviour described somewhere ?
> > Following this logic, the file associated with ticket #1102 would play at
> > 15000/1001 which do not feel natural to me.
> > 
> > Wild guess: the frame duplication occurs because i did not correct the frame
> > pts in the decoder.
> 
> The frame duplication occurs because the decoder outputs one frame every
> two video packets. The outputed frame takes the pts from the second packet
> causing ffmpeg to duplicate one frame. A temporary fix is to use -vsync 0.
> 
> The only ugly solution i see right now (and it seems to work), is to generate
> the ptses for the interlaced + j2k case so that the pair of video packet
> needed to reconstruct a given frame would have the same pts.
> 
> pkt0.pts = 0, pkt1.pts = 0 -> decoded_frame.pkt_pts = 0
> pkt2.pts = 1, pkt3.pts = 1 -> decoded_frame.pkt_pts = 1
> ...
> 
> Better ideas welcomed :)

Lump both packets together, patch the decoder to output an entire frame?
After all, this is what mpeg*.c do (if I'm interpreting the code
correctly).

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130319/bc97e88d/attachment.asc>


More information about the ffmpeg-devel mailing list