Opened 16 months ago

Last modified 16 months ago

#11610 new enhancement

Auto dummy-"split" for filters expecting > 1 input?

Reported by: Alexander Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: split
Cc: Alexander, MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes

Description (last modified by Alexander)

Summary on UX:

A user needs to overlay a logo which is scaled using a reference video as input. The reference video should be also scaled in the same command.

Scale filter fails to scale a video that is used as input for the reference. No error showed, so the user does not have a clue for debugging.

How to reproduce:

 [0:v]scale=-2:720[prepaired]; \
 [1:v][prepaired]scale=-1:rw/8[logo_scaled]; \
 [prepaired][logo_scaled]overlay=10:10

ffmpeg version N-119657-gf1b3e51950 [2025-05-22] [7.1.git]

built with gcc 12 (Debian 12.2.0-14+deb12u1)

The working example:

 [0:v]scale=-2:720,split=2[base][ref]; \
 [1:v][ref]scale=-1:rw/8[logo_scaled]; \
 [base][logo_scaled]overlay=10:10"

While showing an error would be a great help for a user, splitting the output automatically could highly improve user experience.

Change History (6)

comment:1 by Gyan, 16 months ago

The scaled input video gets consumed by the 2nd scale filter so can't be fed to overlay. Use the split filter first.

 [0:v]scale=-2:720,split=2[base][ref]; \
 [1:v][ref]scale=-1:rw/8[logo_scaled]; \
 [base][logo_scaled]overlay=10:10"

in reply to:  1 comment:2 by Alexander, 16 months ago

Thank you, good work around. Seems like a skill issue. It would be great to split automatically, so I'll make a feature request.

Last edited 16 months ago by Alexander (previous) (diff)

comment:3 by Alexander, 16 months ago

Description: modified (diff)
Summary: scale with reference prevents video to be scaled with a second scale filter instanceSplit automatically when input needs a consumed output
Type: defectenhancement

comment:4 by Alexander, 16 months ago

Summary: Split automatically when input needs a consumed outputSplit automatically when input needs an already consumed output

comment:5 by Alexander, 16 months ago

Component: swscaleavfilter
Keywords: split avfilter added

comment:6 by MasterQuestionable, 16 months ago

Analyzed by developer: set
Cc: MasterQuestionable added
Keywords: avfilter scale scale2ref removed
Summary: Split automatically when input needs an already consumed outputAuto dummy-"split" for filters expecting > 1 input?
Version: 7.1git-master

͏    I find this seems to work:
͏    ffmpeg -v debug -hide_banner -nostdin -nostats -f lavfi -i "testsrc=d=1,split=2[-][-]; [-][-]hstack" -c copy -f null -
͏    .
͏    Duplicate label names..?

Note: See TracTickets for help on using tickets.