[FFmpeg-devel] [PATCH 2/2] libx265: Only set the SAR if it is valid

Hendrik Leppkes h.leppkes at gmail.com
Thu Apr 10 15:54:48 CEST 2014

On Thu, Apr 10, 2014 at 3:29 PM, anshul <anshul.ffmpeg at gmail.com> wrote:
> On 04/10/2014 05:58 PM, Derek Buitenhuis wrote:
>> +    if (avctx->sample_aspect_ratio.num > 0 &&
>> avctx->sample_aspect_ratio.den > 0) {
> I don't think this condition is valid.
> I have attached the logs where SAR is 0:1, I have some media with 0:0.
> Please ignore this if those condition are already taken care.
> The below streams with SAR 0:1 and 0:0 are working fine without this patch.
> so please consider this case too.

This is about encoding, and there is absolutely no use in encoding an
invalid SAR (which 0:1 or 0:0 obviously are).
In avcodec, such SAR values mean "invalid". If no SAR is encoded at
all, upon decoding you'll get such an "invalid" or "unset" value back.

The patch looks correct.

- Hendrik

More information about the ffmpeg-devel mailing list