Hi everyone,
have you tried to generate keyframes (scene changes) with the H264/ffmpeg?
I'm struggling with the:
- scene change FFmpeg command
- custom filename
- list of generated jpg files
I'll be glad for any help!
Many thanks,
Mrazik
Keyframes
Re: Keyframes
Hey mrazik,
What exactly are you trying to get done and where is your problem?
Here some command that i used in the past. the output files will be named like thumbs_FRAMENUM.png.
What exactly are you trying to get done and where is your problem?
Here some command that i used in the past. the output files will be named like thumbs_FRAMENUM.png.
Code: Select all
ffmpeg -i F:\temp\608.mxf -vf "select=gt(scene\,0.1), scale=640:360" -vsync vfr -frame_pts 1 "c:\temp\thumbs_%d.png"
emcodem, wrapping since 2009 you got the rhyme?
Re: Keyframes
Hi @emcodem,
thank you for your reply, I'm trying to get generated thumb filenames in the shape "thumb_timecode-of-the-frame.png".
So far without any luck.....
The only thing I can manage is the txt file with generated files, as I can put it as the "Command executor" processor with custom cmd.
Many thanks,
mrazik
thank you for your reply, I'm trying to get generated thumb filenames in the shape "thumb_timecode-of-the-frame.png".
So far without any luck.....
The only thing I can manage is the txt file with generated files, as I can put it as the "Command executor" processor with custom cmd.
Many thanks,
mrazik
FFAStrans 1.2.2
Webinterface 1.2.0.4
- - - - - - - - - - - - - - - -
Intel Xeon CPU E5-1620 v3 @ 3.5GHz
8.00 GB RAM
NVIDIA Quadro K620
256GB SSD
1GB NIC
- - - - - - - - - - - - - - - -
Windows 10 Pro 64b
Webinterface 1.2.0.4
- - - - - - - - - - - - - - - -
Intel Xeon CPU E5-1620 v3 @ 3.5GHz
8.00 GB RAM
NVIDIA Quadro K620
256GB SSD
1GB NIC
- - - - - - - - - - - - - - - -
Windows 10 Pro 64b
Re: Keyframes
Hey,
ok, so let's split up the problems:
1) how to make ffmpeg write the timecode of the frame into the output filename. There are at the best of my knowledge 2 options for this (i might be wrong, better as ffmpeg-user chat):
a) for live recordings we can use
b) for non live we can only put the frame number starting from 0 into the filename
2) the generated filenames to a text file. There are many options for that but not from inside ffmpeg itself.
a) use a batch file after transcode with dir /s /b or such, but i think you already do something like it
b) grep the generated filenames directly from ffmpeg but this is really more simple. Potentially you could add something like:
In that case c:\temp\list.txt would contain the list of generated files but with some unneccessary stuff around like:
[image2 @ 000001b281e65600] Opening 'c:\temp\thumbs_148.png' for writing
Which doesnt really make your life easier than having a batch as you do now.
Note that the requirement to put the "video timecode" into the filename of extracted images is not really a valid solution as the TC of files can wrap over at 24:00, starting from 0 again which would make ffmpeg potentially overwrite some of the exported images, so it is in general not a valid solution to work with the "video timecode" for filenames when extracting thumbs.
ok, so let's split up the problems:
1) how to make ffmpeg write the timecode of the frame into the output filename. There are at the best of my knowledge 2 options for this (i might be wrong, better as ffmpeg-user chat):
a) for live recordings we can use
Code: Select all
-strftime 1 "c:\temp\prefix_%Y-%m-%d_%H-%M-%S.jpg"
Code: Select all
-frame_pts 1 "c:\temp\thumbs_%d.png"
a) use a batch file after transcode with dir /s /b or such, but i think you already do something like it
b) grep the generated filenames directly from ffmpeg but this is really more simple. Potentially you could add something like:
Code: Select all
-loglevel debug 2>&1|findstr Opening 2>&1 > c:\temp\list.txt
[image2 @ 000001b281e65600] Opening 'c:\temp\thumbs_148.png' for writing
Which doesnt really make your life easier than having a batch as you do now.
Note that the requirement to put the "video timecode" into the filename of extracted images is not really a valid solution as the TC of files can wrap over at 24:00, starting from 0 again which would make ffmpeg potentially overwrite some of the exported images, so it is in general not a valid solution to work with the "video timecode" for filenames when extracting thumbs.
emcodem, wrapping since 2009 you got the rhyme?
Re: Keyframes
Hi @emcodem,
thank you very much, I was trying to get the frame number directly in the thumbnail filename.
So what I found out this is not possible to achieve in FFmpeg nodes, so I used command executor node with cmd:
Anyway, thank you!
mrazik
thank you very much, I was trying to get the frame number directly in the thumbnail filename.
So what I found out this is not possible to achieve in FFmpeg nodes, so I used command executor node with cmd:
Code: Select all
%comspec% /C "%s_ffmpegx64% -threads 1 -y -i "%s_original_full%" -vf "select=key,scale=320:-1" -an -vsync 0 -frame_pts 1 "%S_KEYFRAME_PATH%\%s_original_name%\%10d.jpg""
mrazik
FFAStrans 1.2.2
Webinterface 1.2.0.4
- - - - - - - - - - - - - - - -
Intel Xeon CPU E5-1620 v3 @ 3.5GHz
8.00 GB RAM
NVIDIA Quadro K620
256GB SSD
1GB NIC
- - - - - - - - - - - - - - - -
Windows 10 Pro 64b
Webinterface 1.2.0.4
- - - - - - - - - - - - - - - -
Intel Xeon CPU E5-1620 v3 @ 3.5GHz
8.00 GB RAM
NVIDIA Quadro K620
256GB SSD
1GB NIC
- - - - - - - - - - - - - - - -
Windows 10 Pro 64b