4
4
Is there a way to extract the intra-frames and preserve them as-is from FFMPEG or similar program? I know you can extract frames to a sequence of JPEG images using -f image2
. But those are full images of each of the frames. I would like to only export the image of the change in motion, so I would have the P and B frames only showing the change in motion excluding or masking the non-changed area of the images.
Is this possible?
The basic frame export command I'm using. This gives me full framed images of each frame, at the specified FPS.
ffmpeg -i input.mp4 -r 12 -an -b 1024k -y -f image2 frame%4d.jpg
I'm hoping to export the frames so that I have a folder of frames where the first frame would be a full image, the next frame would only be the image data where the image needs to be redrawn. Exposing the temporal redundancy between the two frames (isn't this what I,P,B frames do?)
1The
[in]
and[out]
is not needed in the first example. – slhck – 2013-06-07T09:41:58.250Nice answer, but I recommend providing links to the official documentation for each filter mentioned:
– llogan – 2013-06-07T16:17:19.267select
andshowinfo
.while this does work, I was hoping for a solution that would export all the frame types, but preserve the frames as they are (some being only the image area that needs to be re-drawn, and some being full redraws) – ndmweb – 2013-06-07T23:07:18.163
1@ndmweb You cannot export a non-intra frame "as it is". There is no valid picture information—a P or B macroblock/frame, simply said, only stores the differences between the next picture. I'm afraid in order to do what you want you'd have to look into coding it with MATLAB or similar tools. At least I'm not aware of any existing solution. – slhck – 2013-06-08T08:15:24.133