how to strip a series of characters in dos batch file for filename generation
I've made a batch file for drag and drop conversion of video u开发者_Python百科sing ffmpeg. I'm using avisynth script "avs" as input. The generated video is "my video file.avs.mp4" How can i make the generated video filename to be "my video file.mp4" ? here is my batch:
@echo off
title Converting video for mobile phone... by xXx
ffmpeg.exe -y -i %1 -f mp4 -vcodec libxvid -b 150k -r 25 -maxrate 150k -bt 1k -bufsize 4M -acodec libfaac -ac 1 -ab 32 -ar 22050 -vol 20 -aspect 4:3 %1.mp4
title Finished!!! Press any key to close the window
echo.
echo.
echo.
echo "Success... press any key to close the window."
pause > nul
Thanks in advance!
I suppose your param %1 contains "my video file.avs"
Then this should work
ren "%~1.mp4" "%~n1.mp4"
精彩评论