ffmpeg: Output to the same folder as source with recursive input?

非 Y 不嫁゛ 提交于 2020-01-25 21:07:05

问题


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:


You are missing two command modifiers for your output filename.

"%%~dpna.webm"


来源:https://stackoverflow.com/questions/33266300/ffmpeg-output-to-the-same-folder-as-source-with-recursive-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!