[FFmpeg-devel] [PATCH]Write fiel atom independent of other Video Sample Description Extensions

Tim Nicholson nichot20 at yahoo.com
Mon Feb 4 11:04:30 CET 2013


On 02/02/13 10:35, Carl Eugen Hoyos wrote:
> Hi!
> 
> I may miss something but I don't see why asp or h264 video cannot contain 
> field handling information.
> 
> As a side-effect, this fixes ticket #2202.
> 
> Please review, Carl Eugen
> 
> 
> patchmovfiel.diff
> 
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 08015b5..df52d49 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -1127,13 +1127,14 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
>          mov_write_avcc_tag(pb, track);
>          if(track->mode == MODE_IPOD)
>              mov_write_uuid_tag_ipod(pb);
> -    } else if (track->enc->field_order != AV_FIELD_UNKNOWN)
> -        mov_write_fiel_tag(pb, track);
> -    else if (track->enc->codec_id == AV_CODEC_ID_VC1 && track->vos_len > 0)
> +    } else if (track->enc->codec_id == AV_CODEC_ID_VC1 && track->vos_len > 0)
>          mov_write_dvc1_tag(pb, track);
>      else if (track->vos_len > 0)
>          mov_write_glbl_tag(pb, track);
>  
> +    if (track->enc->field_order != AV_FIELD_UNKNOWN)
> +        mov_write_fiel_tag(pb, track);
> +
>      if (track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num &&
>          track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) {
>          mov_write_pasp_tag(pb, track);

I'm not sure about asp or h264, but writing this atom for all codecs if
interlace information is set will add it to things like DNX, which does
not have it set in "genuine" files.

A lower impact approach that would still fix #2202 would be to simply
bump it to the end of the "else if" set. That way all "Special cases"
can do their thing if required, and the atom will then be set for
everything else.

-- 
Tim


More information about the ffmpeg-devel mailing list