Media Source Recovery

Bombamela

New Member
Hello guys,
I'm using the Media Source of OBS to stream m3u8 link on Windows.
The problem is that sometimes the stream on the link isn't stable and it's stop for 1 second in the Media Source,
and then it's stuck for good until I reload the source manually.

How can I make the Media Source to recover automatically without me need to manually fix it?
Like something that recognize that the sound of the source stopped, or the frames is stuck and automatically reload it?
 
Try setting the reconnect delay to 1s

1628172877668.png
 
Why your network buffering is on 0MB? Mine is on 2MB, should i change it as well?
I'm livestreaming from a local (literally on the same network switch) tvheadend server with no pvr/replay, so there's never any latency or need for network buffering. I don't think changing to 0mb is noticable but you can try it if you want, it won't hurt any.
 

Bombamela

New Member
I'm livestreaming from a local (literally on the same network switch) tvheadend server with no pvr/replay, so there's never any latency or need for network buffering. I don't think changing to 0mb is noticable but you can try it if you want, it won't hurt any.
I'm streaming from Windows 2019 on VPS RDP. Should I?
Anyhow, unfortunately your solution isn't changed anything, but thank you for trying :(

Any other ideas?
 
I'm streaming from Windows 2019 on VPS RDP. Should I?
Anyhow, unfortunately your solution isn't changed anything, but thank you for trying :(

Any other ideas?
I'm not sure, I had a similar issue with glitching live video and changing the network buffering sort of fixed it, but not really. I think it's an issue with network buffering/UDP translation mismatching from the server to OBS. For me VLC doesn't have the same glitching so maybe try use the VLC Media source but idk if they removed it in later OBS updates.
 

Bombamela

New Member
I'm not sure, I had a similar issue with glitching live video and changing the network buffering sort of fixed it, but not really. I think it's an issue with network buffering/UDP translation mismatching from the server to OBS. For me VLC doesn't have the same glitching so maybe try use the VLC Media source but idk if they removed it in later OBS updates.
I already did it, VLC Media Source is even worst, because once it's stuck over there it's also stuck the program itself, and never recovers. the Media Source is a bit better and sometimes do recover, but not always.
 
I already did it, VLC Media Source is even worst, because once it's stuck over there it's also stuck the program itself, and never recovers. the Media Source is a bit better and sometimes do recover, but not always.
Does it play smoothly outside of OBS?
 
Anyone? Nobody build some plugin or any definition I can do to fix it? It's pretty basic.
Thank you
I'm not aware of any plugins.

Comparing settings of smooth playback in VLC to OBS, VLC by default uses:
1628231245585.png

So we know VLC plays smoothly, but I'm unsure if "Network Caching" in VLC is the same as "Network Buffering" in OBS, they aren't always synonymous, and weirdly VLC has a measurement of time (1000ms) and OBS a measurement of data (2MB)...

So VLC will apply a buffer/cache of a length of time despite the filesize. For high bitrate content this will incur more memory usage but will allow for a buffer of the same size whether displaying HD or SD content, whereas OBS will save a buffer/cache based on memory, so for example a 10MB cache of SD content @ 2200kb/s (broadcast standard bitrate for SD content) will be about 36 seconds of video playback (not including audio), whereas for HD content @ 6.7Mb/s that is 11s.

Weirdly I find that changing buffering in OBS to 16MB only increases the frequency of playback interference, so I actually have no clue what that means... Unless it's demanding too much from the server software - so I looked at this next I don't know your server setup, but for me I'm using tvheadend and it shows me the live bitrate/network output of each stream:

When I change my OBS stream to 16MB the network stream will show me this happening when there's lag on the stream:

First the network output will stall to 0kb/s:
1628233453097.png

Then straight afterwards the output will climb, probably sending all of the cached data at once:
1628233601838.png

For comparison, the DVR is directly outputting the stream to an external HDD and never has any network interference.

So going back to the original point - trying to match the buffering/cache of OBS to VLC's playback, first find the bitrate of the content with VLC:
1628233863216.png

1628233909990.png

Then convert from bits to bytes, divide by 8 - so 5078 kiloBITS / 8 = 634 kiloBYTES, that means 0.634MB is the equivelant VLC will be using for network cache (consider live content has variable bitrate so this isn't perfect, you could get an average over time and use that to be more precise). So change OBS's network buffering to 1MB to get the closest buffering to VLC - though isn't perfect by any stretch of the imagination.

Maybe it would be worth asking devs to change network buffering to seconds rather than memory usage? Or adding an option at least... Maybe I could try make a plugin but I've never made anything for OBS before so it might not even be possible to modify it... I'll see what I can do.

Maybe I just confused the situation more lol.
 

Bombamela

New Member
I'm not aware of any plugins.

Comparing settings of smooth playback in VLC to OBS, VLC by default uses:
View attachment 73968
So we know VLC plays smoothly, but I'm unsure if "Network Caching" in VLC is the same as "Network Buffering" in OBS, they aren't always synonymous, and weirdly VLC has a measurement of time (1000ms) and OBS a measurement of data (2MB)...

So VLC will apply a buffer/cache of a length of time despite the filesize. For high bitrate content this will incur more memory usage but will allow for a buffer of the same size whether displaying HD or SD content, whereas OBS will save a buffer/cache based on memory, so for example a 10MB cache of SD content @ 2200kb/s (broadcast standard bitrate for SD content) will be about 36 seconds of video playback (not including audio), whereas for HD content @ 6.7Mb/s that is 11s.

Weirdly I find that changing buffering in OBS to 16MB only increases the frequency of playback interference, so I actually have no clue what that means... Unless it's demanding too much from the server software - so I looked at this next I don't know your server setup, but for me I'm using tvheadend and it shows me the live bitrate/network output of each stream:

When I change my OBS stream to 16MB the network stream will show me this happening when there's lag on the stream:

First the network output will stall to 0kb/s:
View attachment 73969
Then straight afterwards the output will climb, probably sending all of the cached data at once:
View attachment 73970
For comparison, the DVR is directly outputting the stream to an external HDD and never has any network interference.

So going back to the original point - trying to match the buffering/cache of OBS to VLC's playback, first find the bitrate of the content with VLC:
View attachment 73971
View attachment 73972
Then convert from bits to bytes, divide by 8 - so 5078 kiloBITS / 8 = 634 kiloBYTES, that means 0.634MB is the equivelant VLC will be using for network cache (consider live content has variable bitrate so this isn't perfect, you could get an average over time and use that to be more precise). So change OBS's network buffering to 1MB to get the closest buffering to VLC - though isn't perfect by any stretch of the imagination.

Maybe it would be worth asking devs to change network buffering to seconds rather than memory usage? Or adding an option at least... Maybe I could try make a plugin but I've never made anything for OBS before so it might not even be possible to modify it... I'll see what I can do.

Maybe I just confused the situation more lol.
Amazing comment, thank you so much for all the effort you put for it.
I will try what you said, though I'm pretty pessimistic. I will be glad to contact you and pay you to develop such thing as you mention. Let me know if you are interested bro. :)
 
Amazing comment, thank you so much for all the effort you put for it.
I will try what you said, though I'm pretty pessimistic. I will be glad to contact you and pay you to develop such thing as you mention. Let me know if you are interested bro. :)
Let me know how that goes.
 
Top