I'm trying to take screen grabs every 2 seconds from a bunch of video files.
Someone has already kindly provided me with this script for a .bat file:
However, when I drag multiple videos to this .bat file, it only processes the first one."c:\program files\ffmpeg\bin\ffmpeg.exe" -i %1 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n1 - %%05d.jpg"
pause
Given that I know nothing about ffmpeg or scripting, could anyone please provide me with the exact code I need?
Also, I don't know if it's possible, but I'd also like the resulting file names to include the date of the original video, and (if possible) the playback time the grab was taken from.
+ Reply to Thread
Results 1 to 5 of 5
-
-
There is separate thread related to your question - for sure you will find there answer and solution.
https://forum.videohelp.com/threads/356314-How-to-batch-convert-multiplex-any-files-with-ffmpeg -
"%1" means the first argument on the command line -- that is, the first file. The same is true for "%~n1". The rest of the files are ignored. A cheap and ugly way to do what you want is to repeat the same line for each file, specifying successive arguments on each line:
Code:"c:\program files\ffmpeg\bin\ffmpeg.exe" -i %1 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n1 - %%05d.jpg" "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %2 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n2 - %%05d.jpg" "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %3 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n3 - %%05d.jpg" "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %4 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n4 - %%05d.jpg" "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %5 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n5 - %%05d.jpg" pause
Code:IF "%~1"=="" GOTO end "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %1 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n1 - %%05d.jpg" IF "%~2"=="" GOTO end "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %2 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n2 - %%05d.jpg" IF "%~3"=="" GOTO end "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %3 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n3 - %%05d.jpg" IF "%~4"=="" GOTO end "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %4 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n4 - %%05d.jpg" IF "%~5"=="" GOTO end "c:\program files\ffmpeg\bin\ffmpeg.exe" -i %5 -vf fps=fps=1.0/2.0 -qscale:v 2 "%~n5 - %%05d.jpg" :end pause
Code:for %%F in (*.mp5) do ( "c:\program files\ffmpeg\bin\ffmpeg.exe" -i "%%F" -vf fps=fps=1.0/2.0 -qscale:v 2 "%%~nF - %%05d.jpg" )
-
Thank you both so much!
Jagabo's final script is just what I needed. I just changed the file extension in the code (to .mts) and it worked perfectly! -
Oops, I just noticed I typed *.mp5 into that last script when I meant to type *.mp4. In any case, use whatever extension is appropriate for your file type.
Similar Threads
-
How to batch convert/multiplex any files with ffmpeg
By Baldrick in forum User guidesReplies: 215Last Post: 1st Dec 2023, 11:38 -
Batch combining multiple audio files with same picture to create mp4 files
By MD_89 in forum AudioReplies: 25Last Post: 1st Dec 2018, 22:29 -
How to batch translate multiple SRT files
By demowolf in forum SubtitleReplies: 2Last Post: 22nd Jun 2018, 00:02 -
(Help Needed with ffmpeg) how do i batch merge audio files to video files
By wander799 in forum Newbie / General discussionsReplies: 5Last Post: 20th Nov 2016, 14:40 -
FFMPEG - How to record multiple RTMP streams into multiple files
By wwwmaster2k in forum Capturing and VCRReplies: 1Last Post: 11th Jul 2014, 12:51