[FFmpeg-user] tinterlace broken - SAR & DAR wrong

Mark Filipak (ffmpeg) markfilipak at bog.us
Mon Jan 4 22:18:23 EET 2021


On 01/04/2021 02:45 PM, pdr0 wrote:
> Mark Filipak (ffmpeg) wrote
>>
>> You wrote: "What's wrong with using setsar filter after tinterlace?"
>>
>> I tried that from the git-go. I just reran it.
>>
>> ffmpeg -report -i "source 720x480 [SAR 8x9 DAR 4x3] 29.97 fps.VOB"
>> -filter_complex "separatefields,
>> shuffleframes=0 1 2 4 3 6 5 7 8 9, split[Ain][Bin],
>> [Ain]select=not(eq(mod(n\,10)\,2)+eq(mod(n\,10)\,3)+eq(mod(n\,10)\,6)+eq(mod(n\,10)\,7))[Aout],
>> [Bin]select=eq(mod(n\,10)\,2)+eq(mod(n\,10)\,3)+eq(mod(n\,10)\,6)+eq(mod(n\,10)\,7),
>> tinterlace,
>> setsar=sar=8/9, bwdif=mode=send_field:deint=all, decimate=cycle=2[Bout],
>> [Aout][Bout]interleave,
>> tinterlace, setsar=sar=8/9, bwdif=mode=send_frame:deint=interlaced"
>> -codec:a copy -codec:s copy -dn
>> output.mkv
>>
>> Putting setsar after tinterlace doesn't work. I did investigate that but I
>> can't recall why -- I
>> think it's because DAR is then wrong. The report is below.
> 
> 
> You can't interleave images with different dimensions
> 
> Aout has separated fields, to 720x240 , but Bout is 720x480

[Bout] is 720x240: I'm using 'mode=send_field' in 'bwdif=mode=send_field', and the following 
'decimate' doesn't change that. The problem is that 'tinterleave' is marking the output as "SAR = 
16:9" instead of "8:9" (which is what it should be and should never be changed).

SAR cannot change unless DAR/PAR changes (which it doesn't). Look:

SAR = DAR/PAR = (8:3)/(720:240) = (8:3)/(6:2) = 8:9
SAR = DAR/PAR = (4:3)/(720:480) = (4:3)/(3:2) = 8:9

The current tinterlace filter is setting SAR = 16:9. That is just plain wrong.


More information about the ffmpeg-user mailing list