datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.

Home Page:https://docs.datarhei.com/restreamer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Significant Youtube audio stutter regression from 2.8.0 to latest

zedshaw opened this issue · comments

Describe the bug

When sending a stream to Youtube the audio has significant stuttering and/or dropped frames. Here's the particulars:

  1. Video is fine, audio streamed to Youtube via RTMP or HLS has significant stuttering.
  2. Stuttering is not random, happens repeatedly at the same rate. Seems to be periodic dropped frames in the audio stream.
  3. Stuttering is worse when using direct read from RTMP instead of the in memory HLS. From direct RTMP it's so bad it's nearing random static.
  4. Stuttering does not happen when streamed via the Player or restreamed to Twitch.
  5. I completely removed version latest and installed 2.8.0 and 2.7.0 and the streams are just fine. This is only happening in latest and only to Youtube.
  6. I'm streaming directly from an ATEM Mini ISO Pro which is using h264 @ 30fps and 48khz AAC. Rencoding in any way does not fix this. I've tried nearly every setting you have, including mp3 audio, every khz option, and lowering bitrates.

Possible Causes

  1. Distance: The server I'm testing this on is located in Europe while I'm in the US. This doesn't seem likely since it works just fine in 2.8.0 and 2.7.0.
  2. ATEM Streaming format. This also doesn't seem likely since it plays just fine everywhere else, and again works on 2.8.0 and 2.7.0.
  3. Bad data from DR's internal RTMP feed. Again, unlikely since the stuttering also happens with HLS inmemory, and if this was bad data on the RTMP then it'd also be heard on Twitch.

Other than that I don't know enough about the internals to know which. My first hunch is bad ffmpeg build?

To Reproduce

Not too sure how to repeat this, basically stream to Youtube using latest version? I'm willing to actually setup the server, and leave it running to youtube and twitch while I chat with you all to sort out what's happening. I mean, hell I'll even let you log into the box and/or be your hands to try stuff. I'm in Discord if you are we can screenshare there and fix it live.

Expected behavior

I'd expect the audio to be the same as version 2.8.0 or 2.7.0 without stuttering, clipping, or dropped frames when streamed to youtube.

Screenshots

I don't have screenshots but I can provide links to sample videos from Youtube for each version showing the errors, as well as get you access to the actual server with the problem to debug it live. Just let me know.

Desktop (please complete the following information):

  • OS: Debian 12 with latest Docker using the latest instructions for Linux/Debian install.
  • Browser: Audio stuttering happens in every browser, and only happens on Youtube, not embed player or Twitch.
  • Version: latest has problem, 2.8.0 and 2.7.0 do not.

With 2.9.0 we introduced ffmpeg 6.1.1. The previous versions run on ffmpeg 5.1.3. This probably related to this. We will have a look at this.

Can confirm everything @zedshaw wrote above. Audio Stuttering / Robotic Accoustic by Voice, Music, Ingame Sounds etc. at Youtube Stream. Same Source streamed to Twitch at same time everything works fine. Workaround is actual for me to use Version 2.8.0 where everything works perfect.