I'm using ffmpeg to make video clips. This code while create and save the clip but with no name only the extension. How to get it to automatically assign a name. @echo off
cd /d %~dp0
set /p place="Enter location: " %=%
set /p time="Enter time: " %=%
for /F %%a in ('dir /b *.wma') do set FileName=%%~na
What sort of name are you wanting to apply?
The original file name and sequential numbers if I create more than one clip for the same file. Right now, the result is a video icon followed by the extension .mp4. but no name. This is the batch file i'm using now
@echo off
cd /d %~dp0
set /p place="Enter location: " %=%
set /p time="Enter time: " %=%
do set FileName=%%~naffmpeg -i "%place%" -ss %time% -codec copy -t 10 %FileName%.mp4
message edited by jessealford
I started over from scratch an added a file explorer window. Here is the code. It works but the resulting filename is something like this. video.mp4-12035.mp4 @echo off
set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p"
echo selected file is : "%file%"
set /p time="Enter time: " %=%
set name=%RANDOM%ffmpeg -i "%file%" -ss %time% -codec copy -t 10 %file%-%RANDOM%.mp4
pauseNow I only have to manually type the start time
message edited by jessealford