Bug Report Media source lag

  • Thread starter Deleted member 59113
  • Start date
D

Deleted member 59113

Hi all,
I have a few media sources (5 second .mp4 clips) on stream, but every time I play them first time they lag, as soon as i've played it once, it's fine and runs flawlessly, but for some reason the first time lags every single time.

This really does ruin the moment, and whenever I start a stream I have to play all 6 media sources to get the lag issue out of the way, which looks really stupid on stream.

Is there any reason why they lag first time?

*It's only when streaming, If I use offline they play fine, as soon as I click "start streaming" and use them, they lag first time after going live.

It's a silly issue but really annoying as I'm trying to build a few new media clips to play at specific moments, and this really ruins the surprise.
 

Kieshadilla

New Member
Same here! Having the same problem except for the 'only lags when streaming' part. When I show these media sources they lag even if I'm offline. For clarity this happens in OBS, not strictly on stream in my case.
 
Last edited:

R1CH

Forum Admin
Developer
Are they large files on a slow device such as a HDD? Are you also recording to that device when you're streaming?

You may want to consider a format like MKV that is more suitable for instant playback, MP4 requires a lot of seeking.
 
I'm having this same issue. My stinger and a couple other media sources skip and lag like crazy. I have high-end PC and run my visuals from my M.2 SSD. I've compressed my media as much as possible. I'm using .webm to get the lowest file size possible - which is 1.87MB for the stinger and 3.22MB for the other sources. Since I need transparency my choices are limited. I've tried .avi and .mov, but the files sizes are MUCH larger - several GB. What else can be done? What's the max size possible? I don't think I can compress any further.
 

Goodvibesguy

New Member
I'm having this same issue. My stinger and a couple other media sources skip and lag like crazy. I have high-end PC and run my visuals from my M.2 SSD. I've compressed my media as much as possible. I'm using .webm to get the lowest file size possible - which is 1.87MB for the stinger and 3.22MB for the other sources. Since I need transparency my choices are limited. I've tried .avi and .mov, but the files sizes are MUCH larger - several GB. What else can be done? What's the max size possible? I don't think I can compress any further.

I have been dealing with this too and trying to reduce my file sizes as much as possible while keeping transparency. I came across this video guide that showed Lagarith encoding to reduce it significantly, but when I try to do it myself it only outputs a file about 1/3rd the size as opposed to 1/10th like the guy in the video shows. I was really hoping that Lagarith would be the answer, but it doesn't seem to reduce the size enough for it to play smoothly yet.
 

Rawdee Gaming

New Member
I have this issue as well, did any of you guys find a fix yet ?

I've been on OBS Discord for about a week asking for help.

My video files are 5-20 mb and on a SSD drive, this stutter even occurs when not streaming or recording, just by having OBS open.

I have a i7-5820k / 16GB DDR4 Quadcore MEM, GTX 980 Strix OC GFX.

I've tried installing different codecs to see if this is an issue, but the video files run perfectly fine in WMP and VLC.

PLEASE HELP! :)
 

MrGlasco

New Member
Full disclosure, I don't exactly know how OBS handles sources and playing media. With that said, sometimes I like to run my video sources through (what I like to call) a "Browser Buffer" to try taking some processing burden off of OBS. This method resolved the lag issue for me.

Unfortunately this method only works for MP4, WebM, and Ogg video files. The Browser source does not play AVI files (used for transparency). Alternatively, you can look into exporting a transparent AVI file as a non-looping animated GIF file, or convert your AVI to MP4, WebM or Ogg, and then manually Chroma Key the parts that you want transparent using an OBS filter.

Personally, I just use my Elgato Stream Deck to prime my transparent AVI files as I'm going LIVE and just deal with it if it still lags (see Stream Deck Multi Action: GO LIVE!!!).

prime-AVI-files.jpg


For this "Browser Buffer" method, instead of making OBS play a video as a "Media Source" source, I make OBS run a "Browser" source that reads an HTML file with my video coded into it.

browser-source.jpg


Here is an example of how I configure the Browser settings for a 1600x900 resolution source:

browser-source-settings.jpg


Then the local HTML file would contain the following code to automatically play my video at the dimensions of my Browser source, where the video's volume level is set in the code. You can essentially copy the following code into Notepad for editing (TEST.mp4 = your video file location), and then save everything as a HTML file for your Browser source.

HTML:
<video id="myVideo" autoplay width="100%" height="100%" style="position:fixed; right:0; bottom:0; min-width:100%; min-height:100%;">
    <source src="TEST.mp4" type="video/mp4">
</video>
<script>
    var vid = document.getElementById("myVideo");
    vid.volume = 1.0; // NOTE: 0.0 to 1.0 = 0% to 100% Volume
</script>

I hope this helps! :)
 

stanmcking

New Member
Full disclosure, I don't exactly know how OBS handles sources and playing media. With that said, sometimes I like to run my video sources through (what I like to call) a "Browser Buffer" to try taking some processing burden off of OBS. This method resolved the lag issue for me.

Unfortunately this method only works for MP4, WebM, and Ogg video files. The Browser source does not play AVI files (used for transparency). Alternatively, you can look into exporting a transparent AVI file as a non-looping animated GIF file, or convert your AVI to MP4, WebM or Ogg, and then manually Chroma Key the parts that you want transparent using an OBS filter.

Personally, I just use my Elgato Stream Deck to prime my transparent AVI files as I'm going LIVE and just deal with it if it still lags (see Stream Deck Multi Action: GO LIVE!!!).

View attachment 45075

For this "Browser Buffer" method, instead of making OBS play a video as a "Media Source" source, I make OBS run a "Browser" source that reads an HTML file with my video coded into it.

View attachment 45076

Here is an example of how I configure the Browser settings for a 1600x900 resolution source:

View attachment 45077

Then the local HTML file would contain the following code to automatically play my video at the dimensions of my Browser source, where the video's volume level is set in the code. You can essentially copy the following code into Notepad for editing (TEST.mp4 = your video file location), and then save everything as a HTML file for your Browser source.

HTML:
<video id="myVideo" autoplay width="100%" height="100%" style="position:fixed; right:0; bottom:0; min-width:100%; min-height:100%;">
    <source src="TEST.mp4" type="video/mp4">
</video>
<script>
    var vid = document.getElementById("myVideo");
    vid.volume = 1.0; // NOTE: 0.0 to 1.0 = 0% to 100% Volume
</script>

I hope this helps! :)
Tried this and it actually works only now the file(mp4) is not RGB+alpha and has a black background. any solution for this? maybe in the HTML code?
 

Brian Life

New Member
Damn, this is my same problem too. I just spend hour creating a cool Stinger, transition logo with sound and its lagging. Im on OBS 24.0.6 I wonder if they fixed this in Later versions? anyone know?
 

Brian Life

New Member
Found a fix. The movie, video, clip with sound has to be the same frame rate as your OBS preferences. I had my stream/ recording set to 30fps. but the little transition movie (also works with Stingers) was set to 60 fps. that why it lags, chopps. So I re-edited my movie to be 30 fps and now its working flawless.
 

Afroamerinegro

New Member
Found a fix. The movie, video, clip with sound has to be the same frame rate as your OBS preferences. I had my stream/ recording set to 30fps. but the little transition movie (also works with Stingers) was set to 60 fps. that why it lags, chopps. So I re-edited my movie to be 30 fps and now its working flawless.

Lifesaver!!! I had to restore my Mac and forgot my fps weren't matching.
 
Top