Audio is out of sync when going back / resuming an episode #7049

Open
opened 2025-12-22 05:09:59 +01:00 by backuprepo · 5 comments
Owner

Originally created by @TimyIsCool on GitHub (May 29, 2025).

Description of the bug

When I start watching an episode of an anime and leave, say mid way through and come back to resume watching (Exiting the player and then re-entering) the audio is out of sync and the only fix I found is restarting playback although that is hit or miss. I have verified that the audio on the source files are synced and has happened rewatching other episodes

Reproduction steps

  1. Start watching an episode of something
  2. watch far enough in jellyfin saves the timestamp of last watched
  3. Exit player fully, either going to dashboard or exiting the webpage
  4. Return and continue where you left off
  5. Audio is out of sync

What is the current bug behavior?

The audio is out of sync by a few seconds

What is the expected correct behavior?

The audio should be synced during playback

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.10.7

Environment

- OS: Ubuntu 20.04
- Linux Kernel:
- Virtualization: Docker
- Clients: Firefox webplayer
- Browser: Firefox 139
- FFmpeg Version: 
- Playback Method: Remux / Transcode
- Hardware Acceleration: None
- GPU Model:
- Plugins: Intro skipper, Skin manager
- Reverse Proxy: NPM / Nginx
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2025-05-29 13:05:53.631 +00:00] [WRN] [70] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: Unable to cache media attachments for File:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv"
MediaBrowser.Common.FfmpegException: ffmpeg media attachment extraction failed for file:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv"
   at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachmentsInternal(String mediaPath, String inputFile, MediaSourceInfo mediaSource, List`1 extractableAttachmentIds, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachments(String mediaPath, String inputFile, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
[2025-05-29 13:05:53.631 +00:00] [INF] [15] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: "/usr/lib/jellyfin-ffmpeg/ffmpeg" " -dump_attachment:6 \"/config/data/attachments/1/144c1c46-849b-5b90-2d21-554efca6d0c5\" -i file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\" -t 0 -f null null"
[2025-05-29 13:05:54.037 +00:00] [ERR] [122] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: ffmpeg media attachment extraction failed for "file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\"" to "/config/data/attachments/1/144c1c46-849b-5b90-2d21-554efca6d0c5"
[2025-05-29 13:05:54.038 +00:00] [WRN] [122] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: Unable to cache media attachments for File:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv"
MediaBrowser.Common.FfmpegException: ffmpeg media attachment extraction failed for file:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv"
   at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachmentsInternal(String mediaPath, String inputFile, MediaSourceInfo mediaSource, List`1 extractableAttachmentIds, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachments(String mediaPath, String inputFile, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
[2025-05-29 13:05:58.265 +00:00] [INF] [114] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "/cache/transcodes/53c13224933b33aad6649bf5b860bcc8.m3u8"
[2025-05-29 13:05:59.175 +00:00] [INF] [114] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0
[2025-05-29 13:05:59.179 +00:00] [INF] [114] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[2025-05-29 13:05:59.179 +00:00] [INF] [114] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -ss 00:10:51.000 -noaccurate_seek  -i file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -preset veryfast -crf 23 -maxrate 5319230 -bufsize 10638460 -profile:v:0 high -level 51 -x264opts:0 subme=0:me_range=16:rc_lookahead=10:me=hex:open_gop=0 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -sc_threshold:v:0 0 -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=yuv420p\" -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename \"53c13224933b33aad6649bf5b860bcc8-1.mp4\" -start_number 217 -hls_segment_filename \"/cache/transcodes/53c13224933b33aad6649bf5b860bcc8%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/transcodes/53c13224933b33aad6649bf5b860bcc8.m3u8\""
[2025-05-29 13:09:33.542 +00:00] [INF] [129] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "172.17.0.4" request
[2025-05-29 13:09:38.234 +00:00] [INF] [50] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @TimyIsCool on GitHub (May 29, 2025). ### Description of the bug When I start watching an episode of an anime and leave, say mid way through and come back to resume watching (Exiting the player and then re-entering) the audio is out of sync and the only fix I found is restarting playback although that is hit or miss. I have verified that the audio on the source files are synced and has happened rewatching other episodes ### Reproduction steps 1. Start watching an episode of something 2. watch far enough in jellyfin saves the timestamp of last watched 3. Exit player fully, either going to dashboard or exiting the webpage 4. Return and continue where you left off 5. Audio is out of sync ### What is the current _bug_ behavior? The audio is out of sync by a few seconds ### What is the expected _correct_ behavior? The audio should be synced during playback ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.10.7 ### Environment ```markdown - OS: Ubuntu 20.04 - Linux Kernel: - Virtualization: Docker - Clients: Firefox webplayer - Browser: Firefox 139 - FFmpeg Version: - Playback Method: Remux / Transcode - Hardware Acceleration: None - GPU Model: - Plugins: Intro skipper, Skin manager - Reverse Proxy: NPM / Nginx - Base URL: - Networking: - Storage: ``` ### Jellyfin logs ```shell [2025-05-29 13:05:53.631 +00:00] [WRN] [70] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: Unable to cache media attachments for File:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv" MediaBrowser.Common.FfmpegException: ffmpeg media attachment extraction failed for file:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv" at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachmentsInternal(String mediaPath, String inputFile, MediaSourceInfo mediaSource, List`1 extractableAttachmentIds, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachments(String mediaPath, String inputFile, MediaSourceInfo mediaSource, CancellationToken cancellationToken) [2025-05-29 13:05:53.631 +00:00] [INF] [15] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: "/usr/lib/jellyfin-ffmpeg/ffmpeg" " -dump_attachment:6 \"/config/data/attachments/1/144c1c46-849b-5b90-2d21-554efca6d0c5\" -i file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\" -t 0 -f null null" [2025-05-29 13:05:54.037 +00:00] [ERR] [122] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: ffmpeg media attachment extraction failed for "file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\"" to "/config/data/attachments/1/144c1c46-849b-5b90-2d21-554efca6d0c5" [2025-05-29 13:05:54.038 +00:00] [WRN] [122] MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor: Unable to cache media attachments for File:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv" MediaBrowser.Common.FfmpegException: ffmpeg media attachment extraction failed for file:"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv" at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachmentsInternal(String mediaPath, String inputFile, MediaSourceInfo mediaSource, List`1 extractableAttachmentIds, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Attachments.AttachmentExtractor.CacheAllAttachments(String mediaPath, String inputFile, MediaSourceInfo mediaSource, CancellationToken cancellationToken) [2025-05-29 13:05:58.265 +00:00] [INF] [114] MediaBrowser.Controller.MediaEncoding.TranscodingJob: Stopping ffmpeg process with q command for "/cache/transcodes/53c13224933b33aad6649bf5b860bcc8.m3u8" [2025-05-29 13:05:59.175 +00:00] [INF] [114] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0 [2025-05-29 13:05:59.179 +00:00] [INF] [114] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request [2025-05-29 13:05:59.179 +00:00] [INF] [114] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: "/usr/lib/jellyfin-ffmpeg/ffmpeg" "-analyzeduration 200M -probesize 1G -ss 00:10:51.000 -noaccurate_seek -i file:\"/media2/Series/Anime/Mushoku Tensei/Season 2/S02E06-I Don't Want to Die.mkv\" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -preset veryfast -crf 23 -maxrate 5319230 -bufsize 10638460 -profile:v:0 high -level 51 -x264opts:0 subme=0:me_range=16:rc_lookahead=10:me=hex:open_gop=0 -force_key_frames:0 \"expr:gte(t,n_forced*3)\" -sc_threshold:v:0 0 -vf \"setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,min(1920\,1080*a))/2)*2:trunc(min(max(iw/a\,ih)\,min(1920/a\,1080))/2)*2,format=yuv420p\" -codec:a:0 copy -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename \"53c13224933b33aad6649bf5b860bcc8-1.mp4\" -start_number 217 -hls_segment_filename \"/cache/transcodes/53c13224933b33aad6649bf5b860bcc8%d.mp4\" -hls_playlist_type vod -hls_list_size 0 -y \"/cache/transcodes/53c13224933b33aad6649bf5b860bcc8.m3u8\"" [2025-05-29 13:09:33.542 +00:00] [INF] [129] Emby.Server.Implementations.HttpServer.WebSocketManager: WS "172.17.0.4" request [2025-05-29 13:09:38.234 +00:00] [INF] [50] MediaBrowser.MediaEncoding.Transcoding.TranscodeManager: FFmpeg exited with code 0 ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
backuprepo added the
media playback
bug
labels 2025-12-22 05:09:59 +01:00
Author
Owner

@camgaertner commented on GitHub (Jun 1, 2025):

Can reproduce - jellyfin-10.10.7-1

@camgaertner commented on GitHub (Jun 1, 2025): Can reproduce - `jellyfin-10.10.7-1`
Author
Owner

@LennardKit commented on GitHub (Jun 16, 2025):

Can confirm as well on version 10.10.7

But I found an easy fix:

  1. Click on your profile Icon top right and select Settings
  2. Click on Playback
  3. Disable the following option: "Prefer fMP4-HLS Media Container"
  4. Audio is now perfectly in sync!

Hope this helps.

@LennardKit commented on GitHub (Jun 16, 2025): Can confirm as well on version 10.10.7 But I found an easy fix: 1. Click on your profile Icon top right and select **Settings** 2. Click on **Playback** 3. Disable the following option: "Prefer fMP4-HLS Media Container" 4. Audio is now perfectly in sync! Hope this helps.
Author
Owner

@BushTrocity commented on GitHub (Aug 5, 2025):

Can confirm as well on version 10.10.7

But I found an easy fix:

  1. Click on your profile Icon top right and select Settings
  2. Click on Playback
  3. Disable the following option: "Prefer fMP4-HLS Media Container"
  4. Audio is now perfectly in sync!

Hope this helps.

Can confirm this fixes the issue temporarily as now i need to always transcode audio but at least i can watch something for now. The audio sync seems intermittent for me as well which make the bug even more annoying.

@BushTrocity commented on GitHub (Aug 5, 2025): > Can confirm as well on version 10.10.7 > > But I found an easy fix: > > 1. Click on your profile Icon top right and select **Settings** > 2. Click on **Playback** > 3. Disable the following option: "Prefer fMP4-HLS Media Container" > 4. Audio is now perfectly in sync! > > Hope this helps. Can confirm this fixes the issue temporarily as now i need to always transcode audio but at least i can watch something for now. The audio sync seems intermittent for me as well which make the bug even more annoying.
Author
Owner

@RazielKernel commented on GitHub (Aug 28, 2025):

Wow! I never would have guessed!
I had a lot of A/V and subtitles sync issues on a lot of my media files. I used to blame the encoders, but as soon as I disabled fMP4, everything started to work!
Haha, thanks @LennardKit !

Cheers!

@RazielKernel commented on GitHub (Aug 28, 2025): Wow! I never would have guessed! I had a lot of A/V and subtitles sync issues on a lot of my media files. I used to blame the encoders, but as soon as I disabled fMP4, everything started to work! Haha, thanks @LennardKit ! Cheers!
Author
Owner

@PixelGames987 commented on GitHub (Sep 5, 2025):

Is it somehow possible to set this option globally? (For everyone using the jellyfin server). I have a few users and I don't want to tell each one to change that setting.

@PixelGames987 commented on GitHub (Sep 5, 2025): Is it somehow possible to set this option globally? (For everyone using the jellyfin server). I have a few users and I don't want to tell each one to change that setting.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: starred/jellyfin#7049
No description provided.