Opened 7 weeks ago

#9204 new defect

tpad weird behavior on clips that have been joined with concat

Reported by: fduck Owned by:
Priority: normal Component: ffmpeg
Version: git-master Keywords: filter_complex, filter, tpad, concat, filtering
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The "tpad" filter works fine normally, but when I use it on a clip created by joining two or more clips with "concat", it outputs the joined clip without any padding.

Additionally, if I try to use the padded clip by "concat"ing with another clip, it gets even weirder: it outputs the original two concat'ed clips, with a piece from the end of another clip equal to the number of padding frames requested.

How to reproduce:

ffmpeg version: 4.4
built on Mac OS Big Sur (11.2.3)

1. Using tpad on a concat'ed clip:

% ffmpeg -y -i 'input.mp4' -filter_complex '
[0:v] split [one][two];
[one][two] concat [doubled];
[doubled] tpad=stop=30 [outV]
' -map [outV] 'output1.mp4' > output1.txt 2>&1

Expected output: two copies of input.mp4 with a pad of 30 black frames at the end.
Actual output: two copies of input.mp4 with no pad at the end.


2. Trying to concat the tpad'ed clip:

% ffmpeg -y -i 'input.mp4' -filter_complex '
[0:v] split [one][two];
[one][two] concat [doubled];
[doubled] split [one][two];
[one] tpad=stop=30 [one];
[one][two] concat [outV]
' -map [outV] 'output2.mp4' > output2.txt 2>&1

Expected output: two copies of input.mp4 followed by 30 black frames followed by two more copies of input.mp4.
Actual output: two copies of input.mp4 followed by the a repeat of the final 30 frames of input.mp4.

I tried a number of different input videos from diverse sources, all under a minute long, all mp4s in h.264 format.

I tried inserting ", setpts=PTS-STARTPTS" to reset the presentation timestamps after each operation, in case they were causing issues. That made no difference in the output.

Forgive me if this is something caused by user error. I think I understand how tpad is supposed to work, but maybe not.

Attachments (2)

output1.txt (305.9 KB ) - added by fduck 7 weeks ago.
Output of first command
output2.txt (345.3 KB ) - added by fduck 7 weeks ago.
Output of second command

Download all attachments as: .zip

Change History (2)

by fduck, 7 weeks ago

Attachment: output1.txt added

Output of first command

by fduck, 7 weeks ago

Attachment: output2.txt added

Output of second command

Note: See TracTickets for help on using tickets.