Opened 13 hours ago

Closed 7 hours ago

Last modified 6 hours ago

#11257 closed defect (invalid)

"scale" filter "ref_*" not working in Ubuntu Linux builds

Reported by: mytait Owned by:
Priority: important Component: swscale
Version: unspecified Keywords: scale ref_* scale2ref
Cc: MasterQuestionable Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

short: scale filter on linux can not parse the rh or ref_h constant. in windows it works as intended. It seems it has been like this since at least ffmpeg 4.4.1 (oldest version i tested!)

longer:
the scale-filter takes an input visual (video or image) and rescales the input to a desired size. When 2 inputs are provided it replaces the old scale2ref and uses the second input as reference. The size of the reference is represented by the rh or ref_h constant.

see:

https://ffmpeg.org/ffmpeg-filters.html#Options-2

in windows the constant is recognized and used. the exact same command works on windows. on linux it throws an error:

[Parsed_scale_0 @ 0x64e8d0ce8500] [Eval @ 0x7fff00113650] Undefined constant or missing '(' in 'rh*0.5'
[Parsed_scale_0 @ 0x64e8d0ce8500] Cannot parse expression for height: 'rh*0.5'

its seems someone filed a related bug for the CUDA variant as well:

https://trac.ffmpeg.org/ticket/11174

as i am not able to compile ffmpeg i cant test this on 7.1. But i have tested ffmpeg 4,5,6 and 7.0 so i think this has always been there?

How to reproduce:

% ffmpeg -y -i in_reffile.mkv -i in_main.mkv -filter_complex "[1:v][0:v]scale=w=oh*dar:h=rh*0.5" -pix_fmt yuv420p  outf4.mkv

#Works on windows with
#ffmpeg version 2024-08-07-git-94165d1b79-essentials_build-www.gyan.dev

#BROKEN on ubuntu linux with
#ffmpeg version 4.4.1 AMD64
#ffmpeg version 5.1.1 AMD64
#ffmpeg version 6.1.1 AMD64
#ffmpeg version 7.0.2 AMD64
#ffmpeg version 7.0.2 i386





Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (3)

comment:1 by MasterQuestionable, 8 hours ago

Cc: MasterQuestionable added
Keywords: ref_* scale2ref added
Priority: normalimportant
Summary: scale filters implementation of scale2ref broken on linux for ref_h or rh constants. works on windows."scale" filter "ref_*" not working in Ubuntu Linux builds

͏    ffmpeg -v debug -hide_banner -nostdin -nostats -f lavfi -i "testsrc=1x1" -f lavfi -i "testsrc=2x2" -lavfi "scale=rw:-1" -vframes 1 -f null -
͏    https://ffmpeg.org/ffmpeg-filters.html#scale

͏    Potential compilation issue?
͏    Ask Ubuntu..?

Last edited 8 hours ago by MasterQuestionable (previous) (diff)

comment:2 by Gyan, 7 hours ago

Resolution: invalid
Status: newclosed

The ref_* variables were first available in 7.1

Commit bb8044581366fe286e16b14515d873979133dbda

comment:3 by MasterQuestionable, 6 hours ago

͏    How's the "scale2ref" availability amid?
͏    (hopefully no both broken...)

Note: See TracTickets for help on using tickets.