[PR #1625] [CLOSED] Fix: Resseting time is not taking account codec and mime type resulting in isResetting loop #3590

Closed
opened 2026-04-25 00:16:16 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/1625
Author: @fidoriel
Created: 3/21/2023
Status: Closed

Base: masterHead: transcodeForceAAC-getter-bug


📝 Commits (3)

  • ec4bd25 fix
  • a5a3431 Merge branch 'advplyr:master' into transcodeForceAAC-getter-bug
  • 4691b13 extend timeout

📊 Changes

1 file changed (+3 additions, -3 deletions)

View changed files

📝 server/objects/Stream.js (+3 -3)

📄 Description

The long resetting time is not triggered if transcode is triggered because mimetype or codec. This resulted in a resetting loop, always starting a new transcode.

audiobookshelf  | [2023-03-21 06:39:12] INFO: 
audiobookshelf  | [2023-03-21 06:39:13] INFO: [STREAM] Clearing isResetting
audiobookshelf  | [2023-03-21 06:39:13] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37)
audiobookshelf  | [2023-03-21 06:39:13] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode
audiobookshelf  | [2023-03-21 06:39:13] INFO: [FFMPEG] Transcode Killed
audiobookshelf  | [2023-03-21 06:39:14] INFO: Stream Reset New Start Time 28:42.0
audiobookshelf  | [2023-03-21 06:39:14] INFO: [STREAM] START STREAM - Num Segments: 793
audiobookshelf  | [2023-03-21 06:39:14] INFO: [HlsRouter] Resetting Stream - notify client @1734s
audiobookshelf  | [2023-03-21 06:39:14] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282
audiobookshelf  | [2023-03-21 06:39:14] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279)
audiobookshelf  | [2023-03-21 06:39:14] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8
audiobookshelf  | [2023-03-21 06:39:14] INFO: 
audiobookshelf  | [2023-03-21 06:39:14] INFO: [STREAM] Clearing isResetting
audiobookshelf  | [2023-03-21 06:39:15] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37)
audiobookshelf  | [2023-03-21 06:39:15] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode
audiobookshelf  | [2023-03-21 06:39:15] INFO: [FFMPEG] Transcode Killed
audiobookshelf  | [2023-03-21 06:39:16] INFO: Stream Reset New Start Time 28:42.0
audiobookshelf  | [2023-03-21 06:39:16] INFO: [STREAM] START STREAM - Num Segments: 793
audiobookshelf  | [2023-03-21 06:39:16] INFO: [HlsRouter] Resetting Stream - notify client @1734s
audiobookshelf  | [2023-03-21 06:39:16] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282
audiobookshelf  | [2023-03-21 06:39:16] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279)
audiobookshelf  | [2023-03-21 06:39:16] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8
audiobookshelf  | [2023-03-21 06:39:16] INFO: 
audiobookshelf  | [2023-03-21 06:39:16] INFO: [STREAM] Clearing isResetting
audiobookshelf  | [2023-03-21 06:39:17] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37)
audiobookshelf  | [2023-03-21 06:39:17] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode
audiobookshelf  | [2023-03-21 06:39:17] INFO: [FFMPEG] Transcode Killed
audiobookshelf  | [2023-03-21 06:39:18] INFO: Stream Reset New Start Time 28:42.0
audiobookshelf  | [2023-03-21 06:39:18] INFO: [STREAM] START STREAM - Num Segments: 793
audiobookshelf  | [2023-03-21 06:39:18] INFO: [HlsRouter] Resetting Stream - notify client @1734s
audiobookshelf  | [2023-03-21 06:39:18] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282
audiobookshelf  | [2023-03-21 06:39:18] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279)
audiobookshelf  | [2023-03-21 06:39:18] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8

const clearIsResettingTime = this.transcodeForceAAC ? 3000 : 500might change the clearIsResettingTime to 10 seconds. On low powered hardware 3 seconds is to short, and it might falls into the isResetting loop. Maybe the waiting time should be an env var or ui-setting to customize for the device?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/1625 **Author:** [@fidoriel](https://github.com/fidoriel) **Created:** 3/21/2023 **Status:** ❌ Closed **Base:** `master` ← **Head:** `transcodeForceAAC-getter-bug` --- ### 📝 Commits (3) - [`ec4bd25`](https://github.com/advplyr/audiobookshelf/commit/ec4bd259c0d5e77c22e1dc102a61ed9aff07a435) fix - [`a5a3431`](https://github.com/advplyr/audiobookshelf/commit/a5a343104545eb4cdb7dc221a419b843415e12dc) Merge branch 'advplyr:master' into transcodeForceAAC-getter-bug - [`4691b13`](https://github.com/advplyr/audiobookshelf/commit/4691b135d888776c938c1c98558cac3423111815) extend timeout ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/objects/Stream.js` (+3 -3) </details> ### 📄 Description The long resetting time is not triggered if transcode is triggered because mimetype or codec. This resulted in a resetting loop, always starting a new transcode. ``` audiobookshelf | [2023-03-21 06:39:12] INFO: audiobookshelf | [2023-03-21 06:39:13] INFO: [STREAM] Clearing isResetting audiobookshelf | [2023-03-21 06:39:13] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37) audiobookshelf | [2023-03-21 06:39:13] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode audiobookshelf | [2023-03-21 06:39:13] INFO: [FFMPEG] Transcode Killed audiobookshelf | [2023-03-21 06:39:14] INFO: Stream Reset New Start Time 28:42.0 audiobookshelf | [2023-03-21 06:39:14] INFO: [STREAM] START STREAM - Num Segments: 793 audiobookshelf | [2023-03-21 06:39:14] INFO: [HlsRouter] Resetting Stream - notify client @1734s audiobookshelf | [2023-03-21 06:39:14] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282 audiobookshelf | [2023-03-21 06:39:14] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279) audiobookshelf | [2023-03-21 06:39:14] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8 audiobookshelf | [2023-03-21 06:39:14] INFO: audiobookshelf | [2023-03-21 06:39:14] INFO: [STREAM] Clearing isResetting audiobookshelf | [2023-03-21 06:39:15] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37) audiobookshelf | [2023-03-21 06:39:15] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode audiobookshelf | [2023-03-21 06:39:15] INFO: [FFMPEG] Transcode Killed audiobookshelf | [2023-03-21 06:39:16] INFO: Stream Reset New Start Time 28:42.0 audiobookshelf | [2023-03-21 06:39:16] INFO: [STREAM] START STREAM - Num Segments: 793 audiobookshelf | [2023-03-21 06:39:16] INFO: [HlsRouter] Resetting Stream - notify client @1734s audiobookshelf | [2023-03-21 06:39:16] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282 audiobookshelf | [2023-03-21 06:39:16] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279) audiobookshelf | [2023-03-21 06:39:16] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8 audiobookshelf | [2023-03-21 06:39:16] INFO: audiobookshelf | [2023-03-21 06:39:16] INFO: [STREAM] Clearing isResetting audiobookshelf | [2023-03-21 06:39:17] WARN: File path does not exist /metadata/streams/play_ege9befho8m2xsrhrt/output-289.ts (HlsRouter.js:37) audiobookshelf | [2023-03-21 06:39:17] INFO: Segment #289 requested is 287 segments from latest (28:54.0) - Reset Transcode audiobookshelf | [2023-03-21 06:39:17] INFO: [FFMPEG] Transcode Killed audiobookshelf | [2023-03-21 06:39:18] INFO: Stream Reset New Start Time 28:42.0 audiobookshelf | [2023-03-21 06:39:18] INFO: [STREAM] START STREAM - Num Segments: 793 audiobookshelf | [2023-03-21 06:39:18] INFO: [HlsRouter] Resetting Stream - notify client @1734s audiobookshelf | [2023-03-21 06:39:18] INFO: [STREAM] Starting Stream at startTime 28:12.0 (User startTime 28:42.0) and Segment #282 audiobookshelf | [2023-03-21 06:39:18] DEBUG: [Stream] Forcing AAC for tracks with mime type audio/mp4 and codec alac (Stream.js:279) audiobookshelf | [2023-03-21 06:39:18] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -ss 203s -noaccurate_seek -i /metadata/streams/play_ege9befho8m2xsrhrt/files.txt -y -loglevel error -map 0:a -c:a aac -f hls -copyts -avoid_negative_ts make_non_negative -max_delay 5000000 -max_muxing_queue_size 2048 -hls_time 6 -hls_segment_type mpegts -start_number 282 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/play_ege9befho8m2xsrhrt/output-%d.ts /metadata/streams/play_ege9befho8m2xsrhrt/final-output.m3u8 ``` `const clearIsResettingTime = this.transcodeForceAAC ? 3000 : 500`might change the `clearIsResettingTime` to 10 seconds. On low powered hardware 3 seconds is to short, and it might falls into the isResetting loop. Maybe the waiting time should be an env var or ui-setting to customize for the device? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:16:16 +02:00
adam closed this issue 2026-04-25 00:16:16 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3590