Pages

May 26, 2016

Encoder settings: bitrate, profile, key frame alignment and more in Nimble Transcoder

Live Transcoder for Nimble Streamer has wide range of transcoding capabilities which include H.264 encoding. It currently uses x264 library licensed for commercial usage and any customer with our Transcoder may use x264 parameters to set up outgoing stream. This article gives some details on encoder parameters usage.

As you may have seen from our videos In Transcoder playlist, you need to set up transcoding scenario with source streams, transformation blocks and encoder.

Scenarios setup page
Part of ABR scenario setup example
You can see blue block being sources of streams, green blocks for filters to transform the content and orange blocks as outgoing streams encoders. If you point your mouse to any block, you'll see setup icon - you can clock on it to see details dialog.

As example, here's a dialog for "medium" stream scaling filter which sets it to 360p.

Scale filter for 360p resize
Let's open encoder settings.

Default settings for encoder
Currently we support x264 encoder, let's take a look at its parameters.

Key frame alignment allows arranging key frames according to selected approach.
Those are 
  • source
  • fps
  • interval
  • none
They are described below under the screenshot.
Setting key frame alignment
Keeping source key frame alignment is a required feature for creating ABR streams, like you see here or here. The key will be aligned same way as they are aligned in source stream. So if you use it for ABR, you need to use it. This feature is not available when you use FFmpeg as a command-line tool.

FPS value will insert the key frame according to FPS amount defined in the opened edit box.


Interval value will insert key frame in the time point specified as shown below. It is measured in milliseconds. As example, if you have 0 frame at 5900, and 1 frame at 6100, then you set this value to 6000. In this case a new frame will be inserted at 6000, copied from nearest older frame which is 5900.


Having "none", the key frames will be defined by the encoder, the value will be determined based on preset and tune parameters.


There's currently one codec used for video output so Codec field is not changed.

Preset is selected among available presets which you can see on the screenshot below.


Add bitrate parameter if you'd like to set up the bitrate of outgoing stream. Its unit is Kbps so to have 600 Kbps you need to print "bitrate" in parameter name and then enter "600" in the right field as shown below.
Set 600 Kbps bitrate
Notice: you can set constant bitrate for your encoded stream.

To set up the "tune", type it in left field. In the right field you will be able to select value from dropdown list.
The list of all presents and their meanings can be taken from x264 library documentation like this one.
Setting tune for x264 encoder
Profile is set by printing "profile" in the left filed and choosing the value from the drop down on the right. Typical values are "baseline" and "main".

Choosing profile for x264 encoder

If your input stream is anamorphic you might need to save its SAR parameter in the output as well, especially if you’re using a 'scale' filter in your Transcoder pipeline while DAR = SAR x Width / Height. Nimble supports keeping input SAR using keep-sar parameter set to true for encoder in its ‘Video output’ section. SAR/DAR/PAR correlation is described in this article.

You may refer to X264 documentation like this one to see what else you can do with your encoder using various parameter. Setting those parameters will allow you to control your x264 video encoder more efficiently and make output streams according to your business logic.

To set up audio encoding parameters, please check Audio encoder parameters video on our YouTube channel.

Feel free to visit Live Transcoder webpage for other details and contact us if you have any question.

Related documentation


No comments:

Post a Comment

If you face any specific issue or want to ask some question to our team,
PLEASE USE OUR HELPDESK

This will give much faster and precise response.
Thank you.

Note: Only a member of this blog may post a comment.