[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 PresetsVOD_STANDARDVOD_HIGH_QUALITY
adaptiveQuantizationModeVARIANCEVARIANCE
adaptiveQuantizationStrength1.01.0
adaptiveSpatialTransform--true
bAdaptiveStrategyFASTFULL
bframes38
bPyramid--NORMAL
cabactruetrue
deblockAlpha--0
deblockBeta--0
encodingModeTWO_PASSTHREE_PASS
fastSkipDetectionPFramestruetrue
macroblockTreeRatecontrol--true
mixedReferences--true
motionEstimationMethodHEXUMH
mvPredictionModeSPATIALSPATIAL
mvSearchRangeMax1624
partitionsP8X8, B8X8, I8X8, I4X4I4X4, I8X8, P8X8, B8X8,P4X4
profileHIGHHIGH
psyRateDistortionOptimization--1.0
psyTrellis--0.0
quantizerCurveCompression--0.6
rcLookahead4060
refFrames316
sceneCutThreshold00
slices01
subMeRD_ALLRD_REF_ALL
trellisENABLED_FINAL_MBENABLED_ALL
weightedPredictionBFramestruetrue
weightedPredictionPFramesSMARTSMART

-- 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 PresetsVOD_SPEEDVOD_HIGH_SPEEDVOD_EXTRAHIGH_SPEEDVOD_VERY_HIGH_SPEEDVOD_SUPERHIGH_SPEEDVOD_ULTRAHIGH_SPEED
adaptiveQuantizationModeVARIANCEVARIANCEVARIANCEVARIANCEVARIANCEDISABLED
adaptiveQuantizationStrength1.01.01.01.01.00.0
adaptiveSpatialTransformtrue----------
bAdaptiveStrategyFASTFASTFASTFASTFASTNONE
bframes333330
bPyramidNORMAL----------
cabactruetruetruetruetruefalse
deblockAlpha0----------
deblockBeta0----------
encodingModeSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASSSINGLE_PASS
fastSkipDetectionPFramestruetruetruetruetruetrue
macroblockTreeRatecontroltrue----------
mixedReferencestruetruefalsefalsefalsefalse
motionEstimationMethodHEXHEXHEXHEXDIADIA
mvPredictionModeSPATIALSPATIALSPATIALSPATIALSPATIALSPATIAL
mvSearchRangeMax161616161616
partitionsI4X4, I8X8, P8X8, B8X8P8X8, B8X8, I8X8, I4X4P8X8, B8X8, I8X8, I4X4P8X8, B8X8, I8X8, I4X4I8X8, I4X4NONE
profileHIGHHIGHHIGHHIGHHIGHHIGH
psyRateDistortionOptimization1.0----------
psyTrellis0.0----------
quantizerCurveCompression0.6----------
rcLookahead3030201000
refFrames222111
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 Preset ConfigurationsLink Icon

Live PresetsLIVE_HIGH_QUALITYLIVE_LOW_LATENCY
adaptiveQuantizationModeVARIANCEVARIANCE
adaptiveQuantizationStrength1.01.0
adaptiveSpatialTransformtruetrue
bAdaptiveStrategyFASTFAST
bframes33
bPyramidNORMALNORMAL
cabactruetrue
deblockAlpha00
deblockBeta00
encodingModeSINGLE_PASSSINGLE_PASS
fastSkipDetectionPFramestruetrue
macroblockTreeRatecontroltruetrue
mixedReferencestruetrue
motionEstimationMethodHEXHEX
mvPredictionModeSPATIALSPATIAL
mvSearchRangeMax1616
partitionsI4X4, I8X8, P8X8, B8X8I4X4, I8X8, P8X8, B8X8
profileHIGHHIGH
psyRateDistortionOptimization1.01.0
psyTrellis0.00.0
quantizerCurveCompression0.60.6
rcLookahead5010
refFrames53
sceneCutThreshold00
slices11
subMeRD_ALLRD_ALL
trellisENABLED_ALLENABLED_FINAL_MB
weightedPredictionBFramestruetrue
weightedPredictionPFramesSMARTSMART

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

Give us feedback