Consider this part of the script:

FOR %%G IN (Eqr_360_????.jpg) DO (

ffmpeg -f lavfi -i nullsrc=size=3888x3888 -vf format=pix_fmts=gray16le,geq=Y-^(20*^(Y/1939^)*^(3887-X^)/3887^)*gt(Y,1880)  -frames 1 -y %FF%YmapCenter.pgm


Adding "" around this line does not get the script to work. Went for the alternate to then added ^ to protect the parentheses ( ) but gt() could not be protected.

Using "" about the line or using ^ to protect the parentheses () always returns the error ... Unknown function gt(Y,1880

Removing the *gt(Y,1880) allows the script to work.

In a second attempt I removed the CMD FOR statement and set the file name directly. This means there is no command shell conflict, but the error message persists ... Unknown function gt(Y,1880

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Mar 11 at 14:52
  • You need to escape the the brackets in gt(Y,1880) ie gt^(Y,1880^)
    – DavidPostill
    Mar 11 at 14:55
  • Adding the ^ before the parentheses ( as you suggested within gt(Y, 1880) continues to return error Unknown function. Adding ^ to both parentheses also returns error Unknown function.
    – James
    Mar 11 at 22:25
  • Some progress but conflict with FOR %%G IN (Eqr_360_????.jpg) DO ( ... ) persist. I changed the instruction script to read: ffmpeg -f lavfi -i nullsrc=size=3888x3888 -vf format=pix_fmts=gray16le,geq='if(gt(Y,1880),Y-20*(Y/1939)*(3887-X)/3887,Y)' -frames 1 -y %FF%YmapCenter.pgm .... and it works when run without FOR DO ( ...). This means gt() only returns logic True/Faults and not 1 or 0.
    – James
    Mar 12 at 0:12

1 Answer 1


I identified two problems:

  1. gt() not working
  2. FOR %%G IN (Eqr_360_????.jpg) DO ( conflicts with gt() parentheses as quotes do not protect gt() nor does ^.

Solution for problem 1) was resolved by understanding gt() returns only True or False and not 1 or 0. This means gt() cannot be used as arithmetic function. Instead the IF(x,y,z) function was used in conjunction with gt() and solution for problem 2). The script used was:

ffmpeg -f lavfi -i nullsrc=size=3888x3888 -vf "format=pix_fmts=gray16le,geq=if(gt(Y,1880),Y-^(20*^(Y/1939^)*^(3887-X^)/3887^),Y)"  -frames 1 -y %FF%YmapCenter.pgm

Solution for problem 2) was to substitute expression for the FOR %%G IN (Eqr_360_????.jpg) DO (. In its place the following was used:

@echo off
if "%~1" == "" goto END

Set "G=%~n1%~x1"    ::This is the file name with extension

goto START

Granted this did not enable batch processing of files but it works with FFMPEG parentheses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.