Video and Audio get super desynced after some time

Green Bean 501

New Member
Whenever I try to stream Persona 5 Royal, my video and audio get desynced after a some time. I haven't really been able to find a pattern as to why or when it happens, but I can easily go 30 minutes or more without any problems and yet it just suddenly happens. The video is fine but the audio gets speeds up really fast and after a few seconds it doesn't match what's going on at all and eventually stops. For an example, it happens about a minute or two before the end of this stream here. I don't really know how to fix the problem, since it still happens after lowing the graphic settings in game to 60 fps and no anti-aliasing. For reference, here's the log file from that stream
 

qhobbes

Active Member
1. In Windows, we recommend that "Game Mode" be enabled. Game Mode can be enabled via the Windows "Settings" app, under Gaming > Game Mode.
2. Run OBS as Admin. To run OBS as Administrator, right click on the OBS shortcut, properties, advanced, check box, ok, apply, ok.
3. Multiple Game Capture sources are usually not needed, and can sometimes interfere with each other (scene: Scene). You can use the same Game Capture for all your games. If you change games often, try out the hotkey mode, which lets you press a key to select your active game. If you play games in fullscreen, use 'Capture any fullscreen application' mode.
4. Use the QSV encoder instead of x264. That should free up some CPU cycles.
5. In many cases, wireless connections can cause issues because of their unstable nature. Streaming really requires a stable connection. Often wireless connections are fine, but if you have problems, the first troubleshooting step would be to switch to wired. We highly recommend streaming on wired connections.

If still having issues after making those changes, post a new log.
 

Green Bean 501

New Member
I should probably clarify, it's not just a problem with my stream. The video footage has the same issue when i go back and watch it
 

rockbottom

Active Member
There's no encoding lag, just rendering lag/GPU overload, your video is FUBAR before it even gets to the encoder. Audio is lagging really bad too.

20:56:57.714: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes
20:56:58.083: ==== Streaming Start ===============================================
20:57:18.125: [ffmpeg muxer: 'adv_file_output'] Output of file 'E:/Uploaded Videos/Stream footage/2024-04-26_20-56-56.mkv' stopped
20:57:18.126: Output 'adv_file_output': stopping
20:57:18.126: Output 'adv_file_output': Total frames output: 1205
20:57:18.126: Output 'adv_file_output': Total drawn frames: 869 (1282 attempted)
20:57:18.126: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 413 (32.2%)
20:57:18.141: ==== Recording Stop ================================================
20:57:19.355: [rtmp stream: 'adv_stream'] User stopped the stream
20:57:19.355: [rtmp stream: 'adv_stream'] Socket send buffer is 524288 bytes
20:57:19.356: Output 'adv_stream': stopping
20:57:19.356: Output 'adv_stream': Total frames output: 1217
20:57:19.356: Output 'adv_stream': Total drawn frames: 950 (1363 attempted)
20:57:19.356: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 413 (30.3%)
20:57:19.374: ==== Streaming Stop ================================================

22:16:55.935: audio_thread(Audio): min=0.016 ms, median=2.438 ms, max=214.003 ms, 99th percentile=79.112 ms
22:16:55.935: ┗receive_audio: min=0.004 ms, median=1.217 ms, max=127.251 ms, 99th percentile=9.313 ms, 1.22352 calls per parent call
22:16:55.935: ┣buffer_audio: min=0 ms, median=0.002 ms, max=0.623 ms, 99th percentile=0.008 ms
22:16:55.936: ┗do_encode: min=0.027 ms, median=1.206 ms, max=127.243 ms, 99th percentile=9.303 ms
22:16:55.936: ┣encode(Track1): min=0.027 ms, median=1.043 ms, max=28.99 ms, 99th percentile=8.692 ms, 0.676252 calls per parent call
22:16:55.936: ┣send_packet: min=0.001 ms, median=0.084 ms, max=126.37 ms, 99th percentile=1.381 ms
22:16:55.936: ┗encode(adv_stream_audio): min=0.032 ms, median=1.069 ms, max=28.066 ms, 99th percentile=8.913 ms, 0.323748 calls per parent call
22:16:55.936: obs_graphics_thread(16.6833 ms): min=0.075 ms, median=4.025 ms, max=1144.52 ms, 99th percentile=73.711 ms, 72.6698% below 16.683 ms
22:16:55.936: ┣tick_sources: min=0.001 ms, median=0.035 ms, max=1144.35 ms, 99th percentile=0.158 ms
22:16:55.936: ┣output_frame: min=0.055 ms, median=3.101 ms, max=218.157 ms, 99th percentile=72.836 ms


From the items above only 1 & 3 are needed (Game Mode/Fix your Scenes) but I also recommend QSV to reduce the load on the CPU. It will have no trouble encoding two streams & the quality will be better as well since you're using Ultrafast with x264.

Add:
Update your iGPU driver, it's over a year old.

Uncheck Scaling on the recording tab.

Disable AVAST if things are still lagging.
 
Last edited:
Top