[FFmpeg-devel] [PATCH] movenc: enable writing of interlace information back to the 'fiel' atom.

Michael Niedermayer michaelni at gmx.at
Thu Oct 18 17:33:06 CEST 2012


On Thu, Oct 18, 2012 at 11:26:13AM +0100, Tim Nicholson wrote:
> Currently interlace information is carried all the way through the
> chain, being modified as required by options such as "-top" and filters
> such as "setfield" but is then ignored when it comes to setting the
> "fiel" atom, which is mandated for some codecs.
> 
> This patch updates the mov style interlace information from ffmpeg's
> internal flags enabling the atom to be written.
> 
> Passes Fate.
> -- 
> Tim
> 

>  movenc.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 5ca2cc166967a4bb7d2dd944cdadfb23378b43c4  0001-movenc-enable-writing-of-interlace-information-back-.patch
> From 49411c0f39fa95c645b630f3fd51a93bcf39a0ce Mon Sep 17 00:00:00 2001
> From: Tim Nicholson <Tim.Nicholson at bbc.co.uk>
> Date: Thu, 18 Oct 2012 11:17:12 +0100
> Subject: [PATCH] movenc: enable writing of interlace information back to the
>  'fiel' atom.
> 
> ---
>  libavformat/movenc.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 0b0bf83..b422b38 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1103,6 +1103,11 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
>      avio_wb32(pb, 0); /* Data size (= 0) */
>      avio_wb16(pb, 1); /* Frame count (= 1) */
>  
> +    /* Set AVCodecContext.field_order to match current interlace status
> +       this is used to control the writing of the "fiel" atom */
> +    if (track->enc->coded_frame->interlaced_frame)
> +        track->enc->field_order = track->enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;

that looks quite odd, for example assume there is no decoder and
encoder, but just stream copy, coded_frame will be NULL in that case.
or consider the encoder (which can run in a seperate thread) frees
coded_frame somewhere short before top_field_first is accessed.


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121018/da973554/attachment.asc>


More information about the ffmpeg-devel mailing list