# [Fixed] Restream.io suggested settings



## sneaky4oe (Oct 31, 2017)

Hi guys. I'm at restream.io support now, and would like to ask you to set keyframe interval to 2 instead of random number when "enforce streaming service encoder settings" is enabled. It causes lots of troubles for users at end platforms since most of them needs 2 as their keyframe value.

Would be nice to see this change.


----------



## RytoEX (Nov 1, 2017)

sneaky4oe said:


> Hi guys. I'm at restream.io support now, and would like to ask you to set keyframe interval to 2 instead of random number when "enforce streaming service encoder settings" is enabled. It causes lots of troubles for users at end platforms since most of them needs 2 as their keyframe value.
> 
> Would be nice to see this change.



I'm confused by this request.  The current rtmp-services services.json shows this:

```
{
    "name": "Restream.io",
    "common": true,
<snip>
    "recommended": {
        "keyint": 2
    }
},
```

So it should already be doing what you're asking.  Are you saying the behavior of "enforce streaming service encoder settings" for this instance is buggy?


----------



## sneaky4oe (Nov 1, 2017)

Yeah. I've faced some users who had it at 8 for some reason with the "enforce" option enabled for restream.

See the logs: https://gist.github.com/anonymous/2317270bd6442483dea1076219b03791

Keyint at 0, enforcing service's settings.
Keyint at 2, not enforcing anything.
Simple settings.

Keyint's for each case at 30 fps:
250
60
60



Spoiler: log parts



[x264 encoder: 'streaming_h264'] preset: veryfast
[x264 encoder: 'streaming_h264'] settings:
    rate_control: CBR
    bitrate:      2500
    buffer size:  2500
    crf:          0
    fps_num:      30
    fps_den:      1
    width:        1280
    height:       720
    keyint:       250

[x264 encoder: 'streaming_h264'] preset: veryfast
[x264 encoder: 'streaming_h264'] settings:
    rate_control: CBR
    bitrate:      2500
    buffer size:  2500
    crf:          0
    fps_num:      30
    fps_den:      1
    width:        1280
    height:       720
    keyint:       60

[x264 encoder: 'simple_h264_stream'] preset: veryfast
[x264 encoder: 'simple_h264_stream'] settings:
    rate_control: CBR
    bitrate:      2500
    buffer size:  2500
    crf:          0
    fps_num:      30
    fps_den:      1
    width:        1280
    height:       720
    keyint:       60



So, yeah. Enforcing leaves keying at ~8 for some reason.


----------



## sneaky4oe (Nov 1, 2017)

If you set keyint to 2 manually with "enforce" enabled, it works tho. 
But if 0 should be auto - why is it 8.33 then with "enforce" enabled?


----------



## sneaky4oe (Nov 1, 2017)

Another thing from current case. OSx user has it on 2 with "enforce" enabled. KF interval is a variable around 1.8 on stream.


----------



## Boildown (Nov 8, 2017)

Are you counting i-frames generated by scene changes?


----------



## RytoEX (Nov 9, 2017)

A keyint of 250 is the default value for FFmpeg/x264.  It seems like if a user creates a new profile and _does not modify_ the default Keyframe Interval value of 0, OBS will not set the service recommended value until the user changes the value to something, and then changes it back to 0.  It will instead use the FFmpeg/x264 default, which is the 250 you're seeing.

I'm still looking at the code paths to see exactly why this happens.  To clarify, this occurs with all streaming services, not just Restream.


Edit:  I do see why this happens now, but I haven't figured out the best way to fix it yet.  To workaround it, change any setting in the streaming section, then change it back, and hit apply/OK.  For now, I've filed Mantis Issue 1061.


----------



## sneaky4oe (Nov 18, 2017)

@RytoEX Thanks, but is there a way to force keyframe of 2 if user won't change it manually? It causes many problems for unexperienced streamers.


----------



## RytoEX (Nov 19, 2017)

Not that I know of currently, other than the workaround that I've already outlined (change any encoder setting, change it back, hit apply/OK).


----------



## sneaky4oe (Nov 24, 2017)

Why can't you just trigger those "manually changed settings" upon switching to advanced mode?..


----------



## RytoEX (Nov 28, 2017)

I probably could, but I don't think that's the best way to solve the issue.  I've had other responsibilities away from OBS, and then I was away for a while.  Jim has been focused on other development items, and the PR queue had gotten a bit large.  This is something that is on my mind and in my backlog of items to address, I just need time to sit down and think it over or talk it out with another contributor (or Jim).


----------



## sneaky4oe (Nov 29, 2017)

Ok, I see. It would help us a lot, if you'd release a fix at some point. :-)


----------



## sneaky4oe (Dec 11, 2017)

Today I've had a user who for some reason had keyframe interval of 0.8-1.0 when it was set for 2 with unchecking suggested settings at x264. Switching over to nvenc helped though. Is it legal? :-D


----------



## sneaky4oe (Mar 11, 2018)

RytoEX said:


> I probably could, but I don't think that's the best way to solve the issue.  I've had other responsibilities away from OBS, and then I was away for a while.  Jim has been focused on other development items, and the PR queue had gotten a bit large.  This is something that is on my mind and in my backlog of items to address, I just need time to sit down and think it over or talk it out with another contributor (or Jim).



Any news on this bug fix? 
With profile selected to "none" with that "enforce" option ticked, user had "baseline" instead of "main".
And I still have a lot of users with keyint 8 instead of 2.


----------



## sneaky4oe (Apr 8, 2018)

bump


----------



## DarkDench (Apr 16, 2018)

Hello. I have an interval of keyframe 2 (x264) in obs, but restream.io in the statistics after streaming the interval of the keyframe 1. Tell me how to fix this


----------



## sneaky4oe (Apr 16, 2018)

Yeah, that's exactly what I was talking about. Untick those recommended settings. 

@RytoEX @Jim can someone react to this at last please?


----------



## DarkDench (Apr 16, 2018)

"use the encoder settings of the streaming service" -  need to disable. 

I rightly understood?


----------



## sneaky4oe (Apr 16, 2018)

Yes


----------



## DarkDench (Apr 16, 2018)

Thank you


----------



## DarkDench (Apr 19, 2018)

"use the encoder settings of the streaming service" - need to disable. 
The problem is not fixed
P.S. help fix the problem


----------



## Jim (Jul 20, 2018)

I've fixed the bug.  Will be fixed in 22.  Please confirm whether or not you had anything like this happened in simple output mode (not advanced output mode), because this particular bug seemed to be exclusive to advanced output mode.

Sorry this one took so long.  Sometimes certain bugs fly by me, especially when they're in something like advanced output mode which is less used (and really should be less used)


----------



## sneaky4oe (Aug 1, 2018)

Jim said:


> I've fixed the bug.  Will be fixed in 22.  Please confirm whether or not you had anything like this happened in simple output mode (not advanced output mode), because this particular bug seemed to be exclusive to advanced output mode.
> 
> Sorry this one took so long.  Sometimes certain bugs fly by me, especially when they're in something like advanced output mode which is less used (and really should be less used)


Sorry about late reply, I was outside of my city and couldn't test.

So, in current 21.1.2 version on a fresh profile:
1. Simple mode, default values. Keyint = 2
2. Advanced mode, default values. Keyint = 8
3. Advanced mode without enforcing, but with keyint = 0. Keyint = 8

Looks like simple mode is unaffected by that bug, but more and more users want to use advanced.


----------



## sneaky4oe (Aug 20, 2018)

With the 22-d version the issue is still there if you stream to a custom rtmp, not to restream service. A new profile, and keyint is still 8.








Last log:
https://obsproject.com/logs/Rm0yAWV8Jx2YRcoN
keyint:       250

However, it's fixed if you select Restream as a service, not as a custom server, so that's a win. Thanks.


----------



## Osiris (Aug 22, 2018)

The issue is not there with custom server either, there are no streaming settings to enforce with a custom server, so it's set to 0 (=auto).


----------



## sneaky4oe (Aug 22, 2018)

Technically yes, but I believe that 2 seconds is the most common standard than 8. 8 is used for movie encoding, not for streaming.


----------



## RytoEX (Aug 22, 2018)

250 is the default keyint value for x264 for general usage, and it sets the _maximum_ interval between keyframes, not the definitive value for "keyframes will always be at these intervals".  Without some solid explanation and reasoning for changing the default, more than simply comparing movie encoding to live streaming, I don't personally see a reason why we should change the default keyint value at this time.


----------

