[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Tue May 07 2019

How to optimize your H264 codec configuration for different use-cases

OverviewLink Icon

Codec Configurations are a collection of settings to control the behaviour of a codec supported by our service. As most of its settings have a default value, those are chosen to provide good results for multitude of use-cases. However, most of time you will find yourself to optimize your Live or VoD workflow to a specific use case. As Codecs have in general a broad set of settings, finding the right mix for your Codec Configurations and use-case can be very time consuming and requires a deep knowledge of how a particular codec works as well.

Preset Configurations make it easy to achieve this optimizations and let you select between several configuration templates optimized to improve encoding speed, quality and more. If you know what you are doing, you can also use them as a base configuration template, and simply overwrite specific settings with your own values to perfectly optimize them to your needs.


If you are just looking for a table listing all H264 Preset Configurations and their settings, please click here :)


Create a H264 Codec Configuration with Preset ConfigurationLink Icon

Preset Configurations are templates, a codec configuration can be based on. You are still able to define your own values for certain settings as usual by defining them specifically when you create a codec configuration, so they will simply overwrite the template value.

1BitmovinApi bitmovinApi = BitmovinApi.builder()
2 .withApiKey("YOUR_BITMOVIN_API_KEY")
3 .build();
4
5H264VideoConfiguration h264VideoConfiguration = new H264VideoConfiguration();
6h264VideoConfiguration.setName("Your first CodecConfig with Presets");
7h264VideoConfiguration.setProfile(ProfileH264.HIGH);
8h264VideoConfiguration.setBitrate(4500000L);
9h264VideoConfiguration.setPresetConfiguration(PresetConfiguration.VOD_HIGH_QUALITY);
10
11h264VideoConfiguration = bitmovinApi.encoding.configurations.video.h264.create(h264VideoConfiguration);

As of now, 10 preset configurations are available, which are either optimized to achieve higher speeds, quality or low-latency when it comes to live-encodings.

For Live Encodings:

  • LIVE_HIGH_QUALITY
  • LIVE_LOW_LATENCY

For VoD Encodings:

  • VOD_HIGH_QUALITY
  • VOD_STANDARD
  • VOD_SPEED
  • VOD_HIGH_SPEED
  • VOD_VERYHIGH_SPEED
  • VOD_EXTRAHIGH_SPEED
  • VOD_SUPERHIGH_SPEED
  • VOD_ULTRAHIGH_SPEED

Use-Cases explainedLink Icon

As you can tell already from their names, Preset Configurations are designed to optimize a codec configuration for particular use-cases. Their requirements can be typically reduced to either quality, speed or a mix of both. Therefore lets look at some common use-cases and which Preset Configuration would fit best.

High quality video content

Your VoD platform offers movies, or TV shows which are released based on fixed schedule. You most likely have enough time to process this video content and therefore strive to provide high quality video content to your user base. So, as speed is not crucial, and your focus will be on creating high quality outputs with your encodings, the Preset Configuration VOD_HIGH_QUALITY is a good configuration to start.

Hint: While the codec config is tweaked, the bitrate is still a static value and therefore prone to be set too low or too high, which either results in quality loss, or increased CDN delivery costs if too much bitrate is used. Per-Title encoding enables you to perfectly optimize for quality and bitrate consumption on a "per title" basis. Give it a try!

News clips

Something happened somewhere in the world and you want to be the first to show it to everyone, so turn around time is critical. While other factors have an impact on that time as well, using Preset Configurations like VOD_HIGH_SPEED, or VOD_ULTRAHIGH_SPEED enable you to lower the time needed to encode the content and therefore upload it to your storage as soon as possible.

Live Sports / Interactive Streaming / eSports

All these use-cases are low latency scenarios. Their requirements are still a bit different therefore make sure you know your own requirements and what latency you actually need. Using the Preset Configuration LIVE_LOW_LATENCY is a first step to optimize your live-encoding workflow.

User generated Content

User generated content comes in all kind of formats, resolutions and qualities. Depending on your use-case, either a quick turn around time or general good quality output is relevant, probably both :) If you don't enforce certain minimum requirements, like resolutions, bitrates, or formats this can get really tricky. Therefore going with a mid range preset configuration like VOD_STANDARD or VOD_SPEED would be a good first step to generate good quality content in a faster manner.

Those are all common use-cases, however they are also just the tip of the iceberg of use-cases you can handle with integrating our services. So, if you are wondering how your use-case can be covered effectively, let us know :)

VoD Quality Preset ConfigurationsLink Icon

VoD Quality PresetsH264_VOD_STANDARDH264_VOD_QUALITYH264_VOD_HIGH_QUALITY
adaptiveQuantizationModeVARIANCEVARIANCEVARIANCE
adaptiveQuantizationStrength111
adaptiveSpatialTransform-falsetrue
bAdaptiveStrategyFASTFULLFULL
bPyramidNORMALNORMALNORMAL
bframes338
cabactruetruetrue
deblockAlpha-00
deblockBeta-00
encodingModeTWO_PASSTHREE_PASSTHREE_PASS
fastSkipDetectionPFramestruetruetrue
macroblockTreeRatecontrol-truetrue
mixedReferencestruetruetrue
motionEstimationMethodHEXHEXUMH
mvPredictionModeSPATIALSPATIALSPATIAL
mvSearchRangeMax162424
nalHrdNONENONENONE
partitionsP8X8,B8X8,I8X8,I4X4I4X4,I8X8,P8X8,B8X8,P4X4I4X4,I8X8,P8X8,B8X8,P4X4
profileHIGHHIGHHIGH
psyRateDistortionOptimization-11
psyTrellis-00
quantizerCurveCompression-0.60.6
rcLookahead406060
refFrames3416
sceneCutThreshold000
slices-11
subMeRD_ALLRD_ALLRD_REF_ALL
trellisENABLED_FINAL_MBENABLED_ALLENABLED_ALL
weightedPredictionBFramestruetruetrue
weightedPredictionPFramesSMARTSMARTSMART

- means that the default value of the codec configuration is used. Please see the API reference for the respective value.


VoD Speed Preset ConfigurationsLink Icon

VoD Speed PresetsH264_VOD_SPEEDH264_VOD_HIGH_SPEEDH264_VOD_EXTRAHIGH_SPEEDH264_VOD_VERYHIGH_SPEEDH264_VOD_SUPERHIGH_SPEEDH264_VOD_ULTRAHIGH_SPEED
adaptiveQuantizationModeVARIANCEVARIANCEVARIANCEVARIANCEVARIANCEDISABLED
adaptiveQuantizationStrength111110
adaptiveSpatialTransformtrue-----
bAdaptiveStrategyFASTFASTFASTFASTFASTNONE
bPyramidNORMALNORMALNORMALNORMALNORMALNORMAL
bframes333330
cabactruetruetruetruetruefalse
deblockAlpha0-----
deblockBeta0-----
encodingModeSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASS
fastSkipDetectionPFramestruetruetruetruetruetrue
macroblockTreeRatecontroltrue-----
mixedReferencestruetruefalsefalsefalsefalse
motionEstimationMethodHEXHEXHEXHEXDIADIA
mvPredictionModeSPATIALSPATIALSPATIALSPATIALSPATIALSPATIAL
mvSearchRangeMax161616161616
nalHrdNONENONENONENONENONENONE
partitionsI4X4,I8X8,P8X8,B8X8P8X8,B8X8,I8X8,I4X4P8X8,B8X8,I8X8,I4X4P8X8,B8X8,I8X8,I4X4I8X8,I4X4NONE
profileHIGHHIGHHIGHHIGHHIGHHIGH
psyRateDistortionOptimization1-----
psyTrellis0-----
quantizerCurveCompression0.6-----
rcLookahead5030201000
refFrames522111
sceneCutThreshold000000
slices1-----
subMeRD_IPRD_IPQPEL4SATDSADFULLPEL
trellisENABLED_ALLENABLED_FINAL_MBENABLED_FINAL_MBDISABLEDDISABLEDDISABLED
weightedPredictionBFramestruetruetruetruetruefalse
weightedPredictionPFramesSMARTSIMPLESIMPLESIMPLESIMPLEDISABLED

- means that the default value of the codec configuration is used. Please see the API reference for the respective value.


Live Quality Preset ConfigurationsLink Icon

Live Quality PresetsH264_LIVE_STANDARDH264_LIVE_HIGH_QUALITYH264_LIVE_VERYHIGH_QUALITYH264_LIVE_ULTRAHIGH_QUALITY
adaptiveQuantizationModeVARIANCEVARIANCEVARIANCEVARIANCE
adaptiveQuantizationStrength1111
adaptiveSpatialTransformtruetruetruetrue
bAdaptiveStrategyFASTFASTFASTFULL
bPyramidNORMALNORMALNORMALNORMAL
bframes3333
cabactruetruetruetrue
encodingModeSINGLE_PASSSINGLE_PASSSINGLE_PASSTWO_PASS
fastSkipDetectionPFramestruetruetruetrue
macroblockTreeRatecontroltruetruetruetrue
mixedReferencesfalsetruetruetrue
motionEstimationMethodHEXHEXHEXUMH
mvPredictionModeSPATIALSPATIALSPATIALAUTO
mvSearchRangeMax16161616
nalHrdNONENONENONENONE
partitionsI4X4,I8X8,P8X8,B8X8I4X4,I8X8,P8X8,B8X8I4X4,I8X8,P8X8,B8X8I4X4,I8X8,P8X8,B8X8
profileHIGHHIGHHIGHHIGH
rcLookahead20304050
refFrames2235
sceneCutThreshold0000
subMeQPEL4RD_IPRD_ALLRD_REF_IP
trellisENABLED_FINAL_MBENABLED_FINAL_MBENABLED_FINAL_MBENABLED_FINAL_MB
weightedPredictionBFramestruetruetruetrue
weightedPredictionPFramesSIMPLESIMPLESMARTSMART

- means that the default value of the codec configuration is used. Please see the API reference for the respective value.

Give us feedback