7

Producing animations/video is quite new for me. I want to create Quicktime/H.264 videos and I have difficulties to find out what H.264 encoding settings to use for 1080p (25 fps) and 4K (25 fps). By the way is 25 fps the best choice for 1080p and 4K?

Encoding Panel

When I want to create a high quality H.264 video, what settings are relevant?

  1. I guess high quality means "lossless output"?

  2. I have seen this post about bitrate but what values to set in Blender for Bitrate and Minimum and Maximum rate? It is my understanding that the recommended bitrate is 8 Mbps for 1080p and 35-45 Mbps for 4K. But what does this mean for Blender? What values to set for Bitrate and Minimum and Maximum rate? What values to use for Buffer Size? How to determine Buffer Size?

  3. Should I change the values for GOP size? How to determine GOP size?

  4. What "Mux" settings?

Could you maybe explain those concepts a bit?

I really appreciate the discussion but my question is: what values should I enter in the encoding panel? Can someone maybe upload a screenshot of the panel with the recommended values for 1080p and 4k?

Based on the answer I got below it is my understanding that for High Quality HD these would be the Quicktime / H.264 settings:

H.264 encoding for High Quality HD

  • A little bit related: http://blender.stackexchange.com/a/48709/2843 – Samoth Mar 21 '16 at 12:39
  • I have seen that Youtube post, but I still don't know what this means for the settings in Blender –  Mar 21 '16 at 12:40
  • There's a manual page which might help you answer a few of your questions!? – Samoth Mar 21 '16 at 19:26
  • H264 is a delivery/archive format. IE: Finished product. It's not the best file choice for editing. Thats why stock agencies ask for other file formats like Pro Res and Photo JPEG. Their clients are most likely going to edit/color correct it to to suit their individual projects. – Dontwalk Mar 21 '16 at 21:06
  • Try a daily build of Blender 2.79, it has a much improved encoding panel. – dr. Sybren Jun 28 '17 at 21:24

2 Answers2

7

Unfortunately H264 is never going to give you brilliant quality video. It was designed to be efficient on storage and network bandwidth. Take a look at mjpeg or similar for higher quality video.

GOP stands for Group of pictures. And basically means how many frames between I frames. Generally you would have 1 I frame to 24 p frames so the GOP would be 25. The more I frames you have the higher quality picture but the higher storage and network cost too.

I frame is an interframe and is a complete picture. P frames are predicted frames and made up of the predicted changes between the last I frame and the next frame.

Limiting the max bitrate will cause Blender to over compress the image and movement or dark areas will look worse. I can't see any benefit in setting the minimum bitrate

Display Name
  • 194
  • 1
  • 25 fps is considered 'Live' however if you compared a 25fps picture with a 30 or 50fps you would notice a difference. – Display Name Mar 21 '16 at 14:04
  • 2
    "The more I frames you have the higher quality picture" - This isn't really true. You can have a smoother animation at a higher framerate but the individual frames are unaffected. Regardless, you really ought to have a specific framerate in mind for your animation rather than deciding on it at export time. – SuperBiasedMan Mar 21 '16 at 15:05
  • @DisplayName Concerning the bitrate ... those values I showed are the "default" values. What values (average, min, max) would you recommend for the bitrate (1080p and 4K) ? –  Mar 21 '16 at 17:07
  • I am really a newbie in animation / video. That is why I ask if 25 fps is a good choice ? Or is 30fps better ? –  Mar 21 '16 at 17:09
  • Also ... it was my understanding that H.264 is a sort of best practice for video codecs. but now I understand it is old and maybe obsolete ??? What is a better choice for high quality videos ? –  Mar 21 '16 at 17:11
  • 6
    This is wrong. H.264 is tunable, and can be tuned for high quality or for low bandwidth. At high quality settings, it uses less bandwidth than an MJPEG of the same quality. So the only advantage of MJPEG is that there are no patent/licensing issues, an H.264 will almost always look better at the same bit rate or be smaller at the same quality. – Dietrich Epp Mar 21 '16 at 18:10
  • 6
    This is an awful answer. I cant speak to Blender settings, but H.264 is capable of producing brilliant quality, even lossless. Check your facts. – Zombo Mar 21 '16 at 18:17
  • @Steven Penny Can you please give your answer if you have other views on this matter ? –  Mar 21 '16 at 18:22
  • I opened a new question on video codecs. Please give your advices and opinions there ;) –  Mar 21 '16 at 18:26
  • 2
    As others have mentioned - this is plain wrong. h.264 has among other quality parameters a 'CRF' parameter which can be set to give virtually lossless quality. – Nathaniel Bubis Mar 21 '16 at 21:10
  • 1
    Your opening statement is flat wrong and misleading H264 is never going to give you brilliant quality. Yes the default is lossy compression, but it is perfectly capable of high and lossless quality. Do you need to be reminded that Blu-ray uses H.264? http://wikipedia.org/wiki/Blu-ray – Zombo Mar 22 '16 at 02:43
  • 2
    Do you need reminding that it also has to fit on one disk? – Display Name Mar 22 '16 at 03:32
  • http://www.tested.com/tech/photography/667-motion-jpeg-vs-h264-the-best-choice-for-dslr-video/ – Display Name Mar 22 '16 at 03:41
  • 1
    This is a very poor quality answer. Full of misinformation. There are several H264 profiles which are designed for studio and professional work and include high resolution chroma sampling as well as intra-only encoding. – Luke Sep 04 '17 at 15:47
6

I generally follow the guidelines laid out in Vimeo's compression guide.

The US follows 24 FPS for film and animation, 29.976 FPS for video, and as high as possible for games. Europe generally follows 25 FPS for film. This just depends on how you want to animate; it doesn't really matter nowadays. However, if you animate in 24, export your video at 24. If you animate at 60, export at 60.

Video codecs are funny business, because not all available codecs are standardized, and not all distributors support all codecs. For example, H.265, or HEVC, is a great improvement over H.264, but is not widely supported. H.264 is one of the most universally supported codecs, so I would stick with that for now. Because of that, higher bitrate correlates with higher quality video; Vimeo's guideline for 1080p footage is 10k-20Mbps and I would err toward the middle if I want good quality. For 4k footage, I would use around 45Mbps.

This is subject to your... subject matter, of course. If you have a very still shot, higher bitrate will not make it look better. If you have lots of shaking camera, high movement, fast color change, film grain, etc, you will need a higher bitrate to maintain all that detail. A common effect of encoding with too low of a bitrate is smearing, streaking, blocking or ghosting of fast-moving objects. If you see some of these artifacts, raise your bitrate.

Your specific questions:

1 - Lossless compression does not throw away pixels of similar data. The decoder will decompress the data and it will look and behave exactly as the original footage. This will increase file size, but results in a decent reproduction of the footage, especially if you are compressing with H.264, which uses interpolation between I-frames.

2 - "Bitrate" is the target bitrate for the video. Sometimes it needs more to maintain fidelity, sometimes it requires less. Maximum puts a cap on the bitrate the encoder is allowed to use. Minimum is similar. You can safely ignore the minimum unless you really feel the need for a bigger file size. I would put a maximum of 5k-10k above your target, just in case the encoder needs the extra space. "Buffer" is like a pre-fetch for the decoder. How much of the video is pre-loaded to assist in playback and frame interpolation? I have never changed this setting in blender. You can safely ignore the buffer settings unless you're on extremely low-end hardware.

3 - GOP is described in Display Name's answer pretty well. It's basically the distance between keyframes (I-frames). More I-frames increases storage size, but it enables better interpolation.

4 - "Mux" is short for "multiplex," which is the combination of video and audio into one packet of data. I will refer you to the wiki page because muxing is somewhat large. I have also never used these settings in blender. Without audio, there is nothing to mux.

Italic_
  • 1,563
  • 1
  • 9
  • 20
  • thanks. But what specific min and max bitrates would you advice for 1080p and 4K ? –  Mar 21 '16 at 18:42
  • any thoughts on buffer size ? I also understand that if I don't have audio I don't need to worry about Mux ? –  Mar 21 '16 at 18:44
  • 1
    @JanScherders: Ignore buffer size. I think it's only relevant if you need to play the video back on low-end hardware without re-encoding it, which is not relevant to your interests. – Dietrich Epp Mar 21 '16 at 18:46
  • 2
    I don't think your definition of "lossless" is correct. Lossless just means no data is lost in compressing the video, nothing will be approximated, only scaled. Zip is an example of a lossless data compression, and flac is a lossless audio compression. You can still have P-frames if there are areas of the video which did not change, very common in animation. What lossless will avoid is blotchy artifacts, particularly in dark areas. – Schwern Mar 21 '16 at 19:37
  • @Schwern Yes, that seems to be the case. I run a playblast through with lossless and GOP still changes the file size. I will edit my answer. – Italic_ Mar 21 '16 at 20:23
  • If I would set GOP at 25, does this mean that I should have a key frame in every 25 frames ? –  Mar 21 '16 at 23:07
  • It is now my understanding - based at the comments - that I best check Lossless Compression for the best quality ? –  Mar 21 '16 at 23:09
  • @JanScherders The animation has no relevance to the exported video. GOP of 25 means for every 25 frames, the encoder will store a frame in its entirety. The frames between these GOP key frames are interpolated. This works similarly as when working with animation curves, but they have no relation here. I could export a completely still shot and the encoder would still put GOP I-frames at 25-frame intervals. – Italic_ Mar 22 '16 at 00:27
  • Umm, surely you mean 10–20 Mbps and 45 Mbps, not kbps. Also, even 8 Mbps is usually fine for 1080p, no idea about 4K. And for animation you can get away for approximately halved bitrates. Anyway, it's better to use CRF (18 is usually a good value for visually lossless output, but YMMV), while making sure the output bitrate stays within sane bounds. – Alexia Luna Jun 27 '17 at 15:28