[FFmpeg-user] How to restrict ffprobe output to a certain number of frames?

Ulf Zibis Ulf.Zibis at CoSoCo.de
Mon Oct 30 01:42:40 EET 2023


Am 29.10.23 um 22:06 schrieb Torsten Kaiser:
>
> On 29.10.23 20:28, Ulf Zibis wrote:
>> Hi,
>>
>> when I use
>> ffprobe -show_frames INPUT
>> I get all frames.
>> But I only want some frames e.g. the first 10 or frame 100 to 109.
>
> ffprobe doesn't seem to provide anything like -ss -t or -frames. So I assume it always probes the whole thing.
>
> I would suggest you cut the desired frames you need for probing to a temporary snippet.
>
> In Korn this would look like this:
>
> #EXAMPLE VALUES
>
> SOURCE="Source.mp4"
>
> START="10.00" #for 25fps frame-precise with a 0.01 seconds resolution
>
> FRAMES="10" # for cutting  ten frames beginning with the one at 10.00 seconds
>
> PREVIEW="TEST.mp4"
>
> # COMMANDS
>
> ffmpeg -y -ss $START -i $SOURCE  -frames $FRAMES $PREVIEW # generate test clip
>
> ffprobe -show_frames $PREVIEW                                                #probing the preview
>
> rm $PREVIEW #to tidy up
>
> in Korn I can catenate these lines with "&&" to a single line, so that following commands only get executed if their predecessor(s) didn't fail.
>
> Hope it's readable enough to translate it to your preferred coding language.

Thanks for your work!

After long seaching I've found the option "read_intervals", which does it.

-Ulf



More information about the ffmpeg-user mailing list