HLS transcoding - audio gaps related to M3U

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
Grindle
Posts: 1
Joined: Wed Nov 09, 2022 10:23 am

HLS transcoding - audio gaps related to M3U

Post by Grindle »

OS: Arch Linux x86_64 6.0.8-zen1-1-zen
Install: ums / Manual build
Version: 11.5.0 / 11.6.0-50-g48c8a851d
Renderer: Kodi on RPi3 / various Android clients

Firstly, I'm new to this software and practically anything involved in its back-end. The point I'm at now is that I understand almost everything related to the configs and I've looked through the source code slightly, although I don't have coding experience.

My only tangible playback issue right now is that I'm experiencing perceivable audio gaps during playback on all my renderers. With TranscodeVideo = HLS-MPEGTS-H264-AAC set, that is. I don't need HLS for playback up front, but it is required for me to seek during playback. The "audio gaps" I'm referring to are exactly as you might imagine—small blips of silence between two segments of audio. I've come to understand, after looking into this issue for a bit, that it is seemingly related to the M3U functionality of HLS playback, which in UMS is configured to have a segment time of 6.0 seconds. I would also like to clarify that this occurs on all my video files (which happen to be anime .mkv files).

I've recorded a minute of audio from an HLS playback session. The aforementioned audio gaps are both waveform-visible and audible. I created an Audacity project to label the visible gaps in order to average the time between them. It seems they occur at an approximate interval of 6.037125 seconds. The first gaps occur almost exactly at 6.0 and 12.0 seconds, but the interval slowly deviates to >6.0 seconds. I will link the Audacity project along with my debug files below.

Of course I want to try and fix this issue, but I don't have any hints as to why this is occurring. It does not seem renderer-specific as I have tried multiple clients. I tried changing almost all the ffmpeg command line options and simplifying the generated command in general. My arguments were effective as I enabled NVENC, etc, but no arguments solved this issue. I tried stuff like x264 encoder arguments, but I never tried fundamentally changing how the M3U playlist was generated or configured within UMS. I do know that Jellyfin utilizes ffmpeg's built-in HLS muxer and that playback is fine there. I never tried DLNA with them though.

Hopefully a kind and beautiful gentleman can bestow upon me some pointers here. Otherwise I will probably just try and generate more meaningful logs in Jellyfin so I can actually cross compare the back-end functionality more to UMS.

Debug files + Audacity project: https://www18.zippyshare.com/v/COJ0mCfi/file.html

Audacity project showing where the gaps in the waveform are:
Image
Post Reply