In order to output a still image of a video using ffmpeg, you can output it using the following methods:
$ffmpeg-i Original Video .avi-ss144-t148-r24-image2%06d.jpg
Is there a way to output raw I, B, and P frames?
ffmpeg
It's a bitstream.The original video codec is mpeg2.
Simply extracting the MPEG-2 Video bitstream is possible with the following commands:
ffmpeg-i input.ts-c:v copy-fmpeg2 video output.mp2v
Note: AVI containers cannot "correctly" store MPEG-2 Video streams containing B frames. There is a workaround called "Packaged B-frame", but it is up to the video player to handle it correctly.Avoid using AVI containers when handling MPEG-2 Video.
Is there a way to output raw I, B, and P frames?
FFmpeg as a tool probably doesn't have that kind of function.
"Also, even if ""P/B frame only"" data can be retrieved, video decoding cannot be performed correctly with that data alone."Unless you're developing MPEG-2 decoders and analysis tools, otherwise data that doesn't contain I-frames will have no use at all use.
"Also, ""I-frame only data"" can be decoded completely, so it may be meaningful."
The select
filter seems to be able to output.
-vf select=eq(pict_type\,B)
-vf select=eq(pict_type\,P)
-vf select=eq(pict_type\,I)
or -skip_frame nokey
Note:
[ffmpeg]How to print a specific frame from a video as an image: Niconico Video Institute
© 2024 OneMinuteCode. All rights reserved.