i am working on ffmpeg
screen capture and i wan't it to start recording on start up, so i need to give the output video file a name that is different every time i start recording i did find this question very close to what i need, so i ended up with this commands in a batch file:
@echo off
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/" %%a in ('time /t') do (set mytime=%%a%%b)
cd /d E:\ffmpeg\bin
ffmpeg -f dshow -i video="screen-capture-recorder"
-c:v libx264 -r 10 -crf 37 -pix_fmt yuv420p E:\%mydate%_%mytime%.flv
now i get an error in ffmpeg cmd: [NULL @ 0270d2c01] Unable to find a suitable output format for 'E:-04-2014_02:35'
E:-04-2014_02:35 Invalid argument
i know it because the special characters in mytime
:
but i don't know how to change it.
**edited to separate date and time with
_
If you only need it for unique filenames, don't mess around with the special chars and localized format. You can use:
EDIT to "the problem is the file name is like this 20140204_161529 and i wan't it to be like that 2014_02_04_16_15_29" : Use this inside the
for
loop: