I like this method for extracting frames, it is very handy. But when I use the code you provide:
for %%F in (*.mp4) do (
If not Exist "%%~nF" MkDir "%%~nF"
ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%3d.jpg
)
I get two output folders:
One of the file name (which is where I want my images to go) and a test folder (which is where my images do go).
I know this is how the code is supposed to work, but perhaps changes over the past four years has changed something with how this code works now. But really, all in all, it's not TOO inconvenient.
I will also add, for those who want to make GIFs of higher quality, you can just change .jpg to .png.
Also, you can make this work with any video format (or more, at least, as I haven't tested this much) by changing the (.mp4) into (.mkv), which I know works.
I assume all other video formats would work also, such as (.avi), (.mpeg), (.ts), (.flv), etc. - though this is not tested.
But as I am the same as the OP in that I don't understand this code, only copy/paste what I find online and play around with it some, it is handy to just have the .bat files ready to go.
I would just like to know how to fix the "test" folder being created and have the screenshots instead go into the folder it already creates of the file name.
To show how I've altered the code to work with other video formats, I'll include a couple of examples:
The first example, which I know works, is for .mkv files instead of .mp4, making the screenshots into .png.
for %%F in (*.mkv) do (
If not Exist "%%~nF" MkDir "%%~nF"
ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%3d.png
)
The last example SHOULD work for .ts files making the screenshots into .png.
for %%F in (*.ts) do (
If not Exist "%%~nF" MkDir "%%~nF"
ffmpeg -i %%F -r 1 -qscale:v 2 %%~nF\%%~nF-%%3d.png
)