[FFmpeg-trac] #11610(swscale:new): Split automatically when input needs a consumed output (was: scale with reference prevents video to be scaled with a second scale filter instance)
FFmpeg
trac at avcodec.org
Tue May 27 17:06:33 EEST 2025
#11610: Split automatically when input needs a consumed output
-------------------------------------+-------------------------------------
Reporter: Alexander | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Component: swscale
Version: 7.1 | Resolution:
Keywords: scale | Blocked By:
scale2ref |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Changes (by Alexander):
* summary:
scale with reference prevents video to be scaled with a second scale
filter instance
=> Split automatically when input needs a consumed output
* type: defect => enhancement
Old description:
> == Summary of the bug:
>
> 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.
>
> **Result:** Scale filter fails to scale a video that is used as input for
> the reference.
>
> **Tests:** Logo scaled without reference video does not prevent video to
> be scaled (the video is scaled, logo scaled, logo overlayed).
>
> == How to reproduce:
> {{{
> % ffmpeg -y -t 10 -i 'input.mp4' -loop 1 -t 13 -i logo.png
> -filter_complex "\
> \
> [0:v]scale=-2:720[prepaired]; \
> [1:v][prepaired]scale=-1:rw/8[logo_scaled]; \
> [prepaired][logo_scaled]overlay=10:10" -c:v libx264 -preset fast
> output.mp4
>
> ffmpeg version N-119657-gf1b3e51950 [2025-05-22] [7.1.git]
>
> built with gcc 12 (Debian 12.2.0-14+deb12u1)
> }}}
> Patches should be submitted to the ffmpeg-devel mailing list and not this
> bug tracker.
New description:
== 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.
--
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11610#comment:3>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list