[FFmpeg-devel] [PATCH] Set pixel aspect ratio for libxvid encoder

Michael Niedermayer michaelni
Tue Jan 15 19:42:49 CET 2008


On Tue, Jan 15, 2008 at 09:11:33AM +0100, Thorsten Jordan wrote:
> Hello,
> 
> The frontend to the xvid library is not setting the pixel aspect ratio,
> so in resulting AVIs etc., aspect ratio is always 1:1. Other encoders
> like ffmpeg2, ffmpeg4, x264-wrapper can do it.
> 
> Here is a patch to add this functionality for libxvidff.c
> 
> -- 
> Regards, Thorsten

> Index: libavcodec/libxvidff.c
> ===================================================================
> --- libavcodec/libxvidff.c	(Revision 11525)
> +++ libavcodec/libxvidff.c	(Arbeitskopie)
> @@ -407,6 +407,11 @@
>      xvid_enc_frame.motion = x->me_flags;
>      xvid_enc_frame.type = XVID_TYPE_AUTO;
>  
> +    /* Pixel aspect ratio setting */
> +    xvid_enc_frame.par = XVID_PAR_EXT;
> +    xvid_enc_frame.par_width = avctx->sample_aspect_ratio.num;
> +    xvid_enc_frame.par_height = avctx->sample_aspect_ratio.den;

iam not sure what xvid will do if these are invalid, so maybe some check
is needed here (there are cases where the sar is not known)
also they can be vertically aligned

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- 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/20080115/7f801593/attachment.pgp>



More information about the ffmpeg-devel mailing list