1

I'm tearing my hair out trying to get this to work, i assume it's a syntax issue.

I'm experimenting with the curves video filter in ffmpeg. When I enter the coordinates in the standard form;

ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/.88 1/1':g='0/0 0.84/0.88 1/1':b='0/0 0.88/0.88 1/1' curves.png;

....I have no issues.

I am trying, however, to use variables vs fixed numbers for the curve points and i cannot in anyway get ffmpeg to accept it.

For example if i simply type;

var3=0.88

and then repeat the code with;

ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/$var3 1/1':g='0/0 0.84/$var3 1/1':b='0/0 0.88/$var3 1/1' curves.png;

it won't work, it's sees $var3 as being 0.000000

also tried;

ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/${var3} 1/1':g='0/0 0.84/${var3} 1/1':b='0/0 0.88/${var3} 1/1' curves.png;

and

ffmpeg -y -i 0.jpg -vf curves=r='0/0 .83/`echo $var3` 1/1':g='0/0 0.84/`echo $var3 1/1':b='0/0 0.88/`echo $var3 1/1' curves.png;

I'm out of ideas. Could anyone help in this situation, really need these to be variables vs fixed numbers for my purposes.

Thanks!

1 Answer 1

0

Assuming you're using bash or a similar shell, you need double quotes. Single quotes conveys its contents literally.

curves=r="0/0 .83/$var3 1/1":g="0/0 0.84/$var3 1/1":b="0/0 0.88/$var3 1/1"
1
  • Thanks so much! I knew it was simple, but i don't think i would have figured that out for days :)
    – Leon Digz
    Jul 12, 2018 at 21:24

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.