nameing files when saving

January 13, 2017 at 09:55:15
Specs: Windows 64
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


See More: nameing files when saving

Report •

#1
January 13, 2017 at 15:51:49
What sort of name are you wanting to apply?

Report •

#2
January 13, 2017 at 16:49:48
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=%%~na

ffmpeg -i "%place%" -ss %time% -codec copy -t 10 %FileName%.mp4

message edited by jessealford


Report •

#3
January 14, 2017 at 07:22:41
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
pause

Now I only have to manually type the start time

message edited by jessealford


Report •
Related Solutions


Ask Question