开发者

Images that are H264 encoded should be encoded again? What are key frames

开发者 https://www.devze.com 2023-02-11 14:24 出处:网络
I have images which are H264 encoded. I 开发者_如何学Gohave generated a video from these images. Do I need to encode this video again to H264?

I have images which are H264 encoded. I 开发者_如何学Gohave generated a video from these images. Do I need to encode this video again to H264? And also what exactly are keyframes?


You might want to re-check the encoding of the individual images -- H.264 is defined for video, not for individual still images.

Once you've created the video, H.264 encoding would make sense. In particular a great deal of the compression you get from H.264 is from motion prediction -- i.e., you encode a block in one frame based on a similar block in a previous frame (or you can use bidirectional prediction, where it's based on both a previous and a subsequent frame).

A key frame is one that isn't predicted from other frames (i.e., an I-frame) that's used to let something picking up the video in the middle of transmission get synchronized and have a basis for the other frames it's going to receive.


h264 is a codec (code/decode) for video. h264 images don't exist, h264 is a compression algorithm for video. Keyframes are full resolution frames of the video. Additional frames are based off of this. You can use a program to combine images into video if you want and output it as h264.


I am not sure what do you mean by "images that are H264 encoded"...

Sure, you can encode one image with H264! You only can't later open it in picture viewer application, or post it to Facebook... Anyway, if you do so, then it is called a KEY FRAME, and it represents one whole H264 encoded image. They appear in video stream in predefined intervals (GOV Length). All other frames between two KEY FRAMES (also called I-FRAMES or IDR -- Instantaneous Image Refresh) are containing changes that happen on the first image (something that moved, disappeared, changed colour, shape...). Those are: P-Frames (Predictive-coded) and B-Frames (Bi-directionally-predictive-coded). If you have a KEY frame, then some P frames (or B) and again KEY frame, then you have a video stream.

So, if they are H264 encoded images, you can make video out of them, just buy putting them together in some container format, like MKV, MP4, QT...

And there is no need to "encode this video again to H264" since there is nothing to encode again... all video data is already H264 encoded...

0

精彩评论

暂无评论...
验证码 换一张
取 消