0

I have a lot of gifs I want converted to webms in many sub directories, and I have this script which will do it, but it will output to the directory where the script is located:

for /r %%a in ("*.gif") do ffmpeg -i "%%a" -c:v libvpx -crf 12 -b:v 4000k "%%~na.webm"
pause

I've tried a bunch of things, but I can't figure out how to get the output to land in the same sub directory as the input file so I can maintain the folder structure.

Edit: it's a Windows batch file I'm using.

1
  • 2
    What shell scripting language are you using? Might want to tag the question with that.. Commented Oct 21, 2015 at 18:08

1 Answer 1

1

You are missing two command modifiers for your output filename.

"%%~dpna.webm"
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, I knew it'd be something simple.
@t3hPeNgU1NoFd00m please mark my answer as the answer to your question. stackoverflow.com/help/someone-answers

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.