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

Mark Filipak (ffmpeg) markfilipak at bog.us
Sun Jan 3 22:22:09 EET 2021

On 01/03/2021 10:24 AM, Paul B Mahol wrote:
> On Sun, Jan 3, 2021 at 11:45 AM Mark Filipak (ffmpeg) <markfilipak at bog.us>
> wrote:
>> Version N-100546-g2c6f532e0a (latest git build)
>> Summary of the bug:
>> tinterlace works but sets SAR & DAR to bogus values.
>> The package is here:
>> https://www.dropbox.com/t/0WABzvetTF1eT7E4
>> Everything needed to reproduce and source video and my result and log are
>> in the package.
> The change of sar is intended behavior.

Given this:
ffmpeg -report -i source.mkv -vf "tinterlace=mode=merge" -c:a copy -c:s copy -dn tinterlace.mkv
where source.mpv is this:
"Input #0, matroska,webm, from 'source.mkv':
"  Metadata:
"    ENCODER         : Lavf58.65.100
"  Duration: 00:00:01.00, start: 0.000000, bitrate: 857 kb/s
"    Stream #0:0, 4, 1/1000: Video: h264 (High), yuv420p(tv, smpte170m, progressive), 720x240 [SAR 
8:9 DAR 8:3], 59.94 fps, 59.94 tbr, 1k tbn, 119.88 tbc (default)"

tinterlace.mkv should be this: 720x480 [SAR 8:9 DAR 4:3]
but instead is this:
"Output #0, matroska, to 'tinterlace.mkv':
"  Metadata:
"    encoder         : Lavf58.65.100
"    Stream #0:0, 0, 1/1000: Video: h264 (H264 / 0x34363248), yuv420p(tv, smpte170m, top coded first 
(swapped)), 720x480 [SAR 16:9 DAR 8:3], q=2-31, 29.97 fps, 1k tbn (default)"

The discrepancy appears to be causing problems with succeeding filters:
"[Parsed_interleave_7 @ 00000170340dc000] Parameters for input link input1 (size 720x480, SAR 16:9) 
do not match the corresponding output link parameters (720x240, SAR 8:9)
"[Parsed_interleave_7 @ 00000170340dc000] Failed to configure output pad on Parsed_interleave_7
"Error reinitializing filters!
"Failed to inject frame into filter network: Invalid argument
"Error while processing the decoded data for stream #0:0
"Conversion failed!"

The succeeding filters are shuffleframes, split, select, tinterlace, bwdif, decimate, interleave, 
tinterlace, and bwdif. The problem appears to be provoked by interleave.

I promise to follow this message with the full command line and full report if you promise not to 
ask me why I'm doing such seemingly crazy processing.  :-)

Honestly, I'm not trying to be coy. I'm simply trying to keep this use-case simple and prevent this 
thread from getting off topic. The problem appears to be with tinterlace's SAR.


More information about the ffmpeg-user mailing list