Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 9th December 2023, 17:55   #1  |  Link
hellgauss
Registered User
 
hellgauss's Avatar
 
Join Date: Sep 2002
Location: Italy
Posts: 108
Using ffmpeg to capture frame by number

I need to capture several video frames as .png from .mkv files in an automated way, starting from the frame numbers.

I use the following .bat file (windows) which extracts e.g. 4 frames from a .mkv with yuv video.

Code:
set "f1=12345"
set "f2=55555"
set "f3=111111"
set "f4=141414"

ffmpeg -y -bitexact -i "myvideo.mkv" -map 0:v -vf "select='eq(n,%f1%)+eq(n,%f2%)+eq(n,%f3%)+eq(n,%f4%)'" -fps_mode passthrough -sws_flags accurate_rnd+full_chroma_int -bitexact "im_%%d.png"
The output seems to be ok for me. The problem is that ffmpeg parse (re-encode?) the whole video and it takes *a lot* of time, especially if I use the -sws_flags which I need for precision.

Is there a way to do that in a fast way without calculating the exact timestamp of the frames?

If needed I can also switch to another command-line windows utility, as long as it is well tested and the yuv-->rgb conversion is accurate.

Thanks
HG
hellgauss is offline   Reply With Quote
 

Tags
ffmpeg, frames

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.