Conversion for Adaptive Bitrate streaming

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

Post Reply
stream4life
Beginner
Beginner
Posts: 4
Joined: Wed Feb 19, 2014 6:46 pm

Conversion for Adaptive Bitrate streaming

Post by stream4life » Wed Feb 19, 2014 6:49 pm

I am planning to use Mediacoder for converting video files which are to be used for Adaptive Bitrate streaming. For that, the converted videos should be keyframe alligned. For that, i want to set the keyframe interval, that is, the time between keyframes. Where can i set this value?

User avatar
HuggiL
Modest
Modest
Posts: 233
Joined: Tue Oct 18, 2011 3:44 am
Location: Perth, Australia

Re: Conversion for Adaptive Bitrate streaming

Post by HuggiL » Thu Feb 20, 2014 2:35 pm

What video codec are you converting to and what encoder are you using? The available settings will change depending on what encoder you're using.
In theory, theory and practice are the same. In practice, they are not.

Tips & Guides: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Older versions: http://www.videohelp.com/tools/MediaCoder/old-versions#download

stream4life
Beginner
Beginner
Posts: 4
Joined: Wed Feb 19, 2014 6:46 pm

Re: Conversion for Adaptive Bitrate streaming

Post by stream4life » Thu Feb 20, 2014 7:16 pm

HuggiL wrote:What video codec are you converting to and what encoder are you using? The available settings will change depending on what encoder you're using.

Video : H264
Audio : AAC
Container : Mp4

So, Where can i adjust the key-frame interval?

meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Re: Conversion for Adaptive Bitrate streaming

Post by meRobs » Thu Feb 20, 2014 9:22 pm

The keyframe interval is set on the x264 tab opposite the Video tab.
It is displayed as GOP and is expressed as a range.
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download

stream4life
Beginner
Beginner
Posts: 4
Joined: Wed Feb 19, 2014 6:46 pm

Re: Conversion for Adaptive Bitrate streaming

Post by stream4life » Fri Feb 21, 2014 9:26 pm

meRobs wrote:The keyframe interval is set on the x264 tab opposite the Video tab.
It is displayed as GOP and is expressed as a range.

I want to set a key-frame interval between 1 and 5. What range should i set in GOP to achieve this?

meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Re: Conversion for Adaptive Bitrate streaming

Post by meRobs » Sat Feb 22, 2014 2:10 pm

If you want the encoder to choose what it wants over the range you suggest, set GOP = 1 ~ 5 (in the two panels), ie min-1 and max=5.
It seems to me to be strange and unusual to want an interval at or near 1 because that would mean virtually all frames are I-frames (full), ie, uncompressed. Assuming the encoder would take any notice of that setting, the file size would be large.

Usually, people set the max interval as ~10x the frame rate (250 for PAL) and the min equal to the fps (25), but, there are advantages in using smaller values. This I found expecially so whe scrubbing in the NLE editor, Adobe Premiere. Then I found that scrubing through the video was smoother and quicker when the min/max for H.264/MP4 files was reduced to 10/20, which was onlky marginally better than 20/50. Any lower than 10/20 gave no noticeable advantage.

When you make a choice and try it, the resultant values are seen in the MediaInfo display under the parameter: 'Encoding settings' (scroll through) as 'keyint' and 'keyint_min'. These are probably just a record of what was set rather that what the encoder actually gave.
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download

stream4life
Beginner
Beginner
Posts: 4
Joined: Wed Feb 19, 2014 6:46 pm

Re: Conversion for Adaptive Bitrate streaming

Post by stream4life » Mon Feb 24, 2014 5:31 pm

meRobs wrote:If you want the encoder to choose what it wants over the range you suggest, set GOP = 1 ~ 5 (in the two panels), ie min-1 and max=5.
It seems to me to be strange and unusual to want an interval at or near 1 because that would mean virtually all frames are I-frames (full), ie, uncompressed. Assuming the encoder would take any notice of that setting, the file size would be large.

Usually, people set the max interval as ~10x the frame rate (250 for PAL) and the min equal to the fps (25), but, there are advantages in using smaller values. This I found expecially so whe scrubbing in the NLE editor, Adobe Premiere. Then I found that scrubing through the video was smoother and quicker when the min/max for H.264/MP4 files was reduced to 10/20, which was onlky marginally better than 20/50. Any lower than 10/20 gave no noticeable advantage.

When you make a choice and try it, the resultant values are seen in the MediaInfo display under the parameter: 'Encoding settings' (scroll through) as 'keyint' and 'keyint_min'. These are probably just a record of what was set rather that what the encoder actually gave.

I choosed an interval of 1-5 because, in my guide, there is a line. I am quoting it as follows.

Code: Select all

 The keyframe interval, that is, the time between keyframes, should be low. A low keyframe 
interval will allow the player to switch streams quickly. If the player has to wait too long for 
the next keyframe, the end user experience will degrade. A setting of 1 – 5 seconds between 
keyframes works well. 

User avatar
HuggiL
Modest
Modest
Posts: 233
Joined: Tue Oct 18, 2011 3:44 am
Location: Perth, Australia

Re: Conversion for Adaptive Bitrate streaming

Post by HuggiL » Tue Feb 25, 2014 8:45 pm

A setting of 1 – 5 seconds between keyframes works well.
From my understanding, the GOP setting refers to how many frames it should set the interval, not how many seconds. So it will be dependent on your framerate. For example, your setting of 1-5 seconds on a 25fps video will have a GOP setting of 25-125. If you had a 30fps video, it would be 30-150.
Also ties in with what meRobs said:
Usually, people set the max interval as ~10x the frame rate (250 for PAL) and the min equal to the fps (25)
But you might want to wait until meRobs can confirm if my suspicions are true regarding the GOP settings since I've never played around with them.
In theory, theory and practice are the same. In practice, they are not.

Tips & Guides: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Older versions: http://www.videohelp.com/tools/MediaCoder/old-versions#download

meRobs
Expert
Expert
Posts: 3116
Joined: Tue Jun 23, 2009 2:45 pm
Location: Sydney, Australia

Re: Conversion for Adaptive Bitrate streaming

Post by meRobs » Wed Feb 26, 2014 9:21 am

Sorry, my comments above express the keyframe interval in 'frames' since that is the way a GOP is expressed.
Thus, a GOP equal to the framerate, say 25 for PAL, amounts to 1 sec (25 frames), and 5 sec represents a GOP of 5x25= 125 frames.
This range is similar to the usual range I mentioned above. The default for many codecs is 250 frames.
I prefer an even smaller ramge -- I often set GOP= 10 to 20 or 25 for critical work.
Have you checked out the Tips & Guides for MediaCoder? Try: http://forum.mediacoderhq.com/viewtopic.php?f=17&t=8061
Also, get older builds at: http://www.videohelp.com/tools/MediaCoder/old-versions#download

Post Reply