Extracting images from a video using FFMPEG

I'm using FFMPEG to extract all images from a video file (MKV container), but how do I extract the exact images from the video frames with no quality loss?

For example the video file is 184MB, I extract using PNG and the total size of the images extracted comes out as 14.9GB. Which is way more than the Video.

If I use JPG then the size is still larger at 383MB.

How do I extract the exact images of the frames in the video so that the total image size is the same as the video size?

Attached: 1546906162855.png (1280x624, 179K)

Other urls found in this thread:

quora.com/If-I-use-still-images-in-a-video-will-it-compress-to-be-a-much-smaller-file-size
ffmpeg.org/ffmpeg-codecs.html#png
twitter.com/NSFWRedditGif

you dumb nigger. of course it's gonna be larger, since video uses a different kind of compression. nothing you can do about it.

I don't think that's really possible, jpeg compression works differently from video compression frame to frame. I think video compression re-uses previous frame data in subsequent frames if its similar or the same.

quora.com/If-I-use-still-images-in-a-video-will-it-compress-to-be-a-much-smaller-file-size

I'm asking how I would get those exact images from the video file without any conversion done to the image format.

>How do I extract the exact images of the frames in the video so that the total image size is the same as the video size?
That will never happen. Your video was compressed using a lossy compression format (AVC, HEVC, VP8, VP9, AV1, etc.) and in addition to that video codecs not only use intra compression (a frame can be decoded by itself), but also inter compression (a frame depends on previous or following frames to decode).
In short you can't save those images lossless and except anything close to the same file size.

However, by default ffmpeg uses a very fast compression preset for PNGs. If you add -compression_level 100 to your command it should produce considerably smaller images at the cost of taking quite a bit longer to extract them.

like this?
fmpeg -i C:\input.MKV -compression_level 100 C:\image%05d.PNG

Yes.
If ffmpeg crashes, you can extract the frames with the default compression level and optimize them afterwards (e.g. with pingo).

it works, just that adding in the compression level 100 almost does nothing to the size of the file, it reduces it by 0.33%

Care to post one of those PNGs?

Its porn

>what are bitmaps

>that adding in the compression level 100 almost does nothing
Does not surprise me.
> -compression_level 100
... is not a valid parameter for PNG output.
ffmpeg.org/ffmpeg-codecs.html#png

Just omit the compression_level bullshit.
If you think i talk shit: compare file hashes with and without the parameter.
Hint: They will be the same.

If you want an exact copy of a frame:
>.bmp

Oh, and please, use google (or what the fuck you want to use) next time. Ffmpeg has a good documentation. Use it!

>without any conversion done to the image format
That's what the video file is. A stream of i-frames and some data to reconstruct the p/b-frames. If you want to view the individual frames of a video as stills, that's what your video player's pause button and frame forward/backward is for.

>... is not a valid parameter for PNG output.
>ffmpeg.org/ffmpeg-codecs.html#png
You know how many parameters aren't listed in the online or internal documentation?
Here's the result of
ffmpeg -i OP.png -compression_level 100 100.png

Attached: 100.png (1280x624, 167K)

And here the output of
ffmpeg -i OP.png -compression_level 0 0.png

Attached: 0.png (1280x624, 2.29M)

ffmpeg -i test.mkv -r 29.97 -f image2 [folder name]/%02d.png

if you don't set a compression level, isn't 100 the defualt?

>play video in mpv.
>resize window way down.
>hold down screenshot button.

Attached: 1512585483596.jpg (512x512, 29K)

>How do I extract the exact images of the frames in the video so that the total image size is the same as the video size?
unless its an iframe-only video (uncommon), you cant. Iframes can be extracted as-is as single frame 'videos', but other frame types must also store the frames back to the last iframe, due to how video compression works

>For example the video file is 184MB, I extract using PNG and the total size of the images extracted comes out as 14.9GB. Which is way more than the Video.
sounds about right
>If I use JPG then the size is still larger at 383MB.
also sounds about right (don't do this, unless you're really strapped for space)

>How do I extract the exact images of the frames in the video so that the total image size is the same as the video size?
the issue is, because it's video, frames depend on other frames, it's why that video can be as small as it is (otherwise, it'd be about the size of that pile of JPG files)
when you're done doing whatever the hell processing you're doing where you need to dump all the frames, you can re-encode the video from those frames (don't forget to extract the audio from the video too) and get something around that 184MB filesize

...