Hello, I need to convert the code from a .sh file into a .bat file by changing the syntax accordingly.

Source

#!/bin/sh palette="/tmp/palette.png" run="`pwd`/ffmpeg/bin/ffmpeg.exe" filters="fps=25,scale=0:-1:flags=lanczos" $run -v warning -i $1 -vf "$filters,palettegen" -y $palette $run -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 

what I myself tried to do by searching for a solution on the net

 SET PALETTE = "/tmp/palette.png" SET RUN = "'%CD%'/ffmpeg/bin/ffmpeg.exe" SET FILTERS = "fps=25, scale=0:-1:flags=lanczos" %RUN% -v warning -i $1 -vf %FILTERS%" ,palettegen" -y %PALETTE% %RUN% -v warning -i $1 -i %PALETTE% -lavfi %FILTERS% " [x]; [x][1:v] paletteuse" -y $2 

But my option does not work. Tell me where I was wrong.

  • here "/tmp/palette.png" - there is no such way under Windows (and in principle there can be no file in a bat). Write the right way there. - KoVadim
  • Slashs don't plow too. It is necessary to change backslashes. - don Rumata
  • @KoVadim I changed my slashes and tried to configure a relative path, but it still does not work
  • Try to print the commands that are obtained as a result (I'm confused in all these variables :). And then try to execute them directly. And there it will be clear - KoVadim

0