Request: Support for opus #41

Closed
opened 2026-04-24 22:57:00 +02:00 by adam · 9 comments
Owner

Originally created by @vsey on GitHub (Oct 2, 2021).

I was on the look for something like this for a long time. So thanks for creating it. I works very well.
I have only a minor issue, I have some of my audiobooks in the opus audio format, and they don't appear in the library overview.
So it would be grate if the player would support opus

Originally created by @vsey on GitHub (Oct 2, 2021). I was on the look for something like this for a long time. So thanks for creating it. I works very well. I have only a minor issue, I have some of my audiobooks in the opus audio format, and they don't appear in the library overview. So it would be grate if the player would support opus
adam closed this issue 2026-04-24 22:57:00 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 2, 2021):

Welcome, I just added support for opus in v1.3.5.

@advplyr commented on GitHub (Oct 2, 2021): Welcome, I just added support for opus in `v1.3.5`.
Author
Owner

@alfureu commented on GitHub (Jan 30, 2022):

I have a weird issue. The files are in .opus format, and whenever I trigger the playback, I get the following error:

image

The files play perfectly in VLC.

The logs show the following:

[2022-01-30T19:39:52.316Z]  INFO: [StreamManager] Open Stream Request aAHr7H2t2-bSEeiNAAAO ab_vn5z25oma0uj2mlxd5
[2022-01-30T19:39:52.316Z]  INFO: Closing client stream first str_o9lvzmhkqx1u2hce5c
[2022-01-30T19:39:52.316Z]  INFO: Closing Stream str_o9lvzmhkqx1u2hce5c
[2022-01-30T19:39:52.317Z]  INFO: Deleted session data /metadata/streams/str_o9lvzmhkqx1u2hce5c
[2022-01-30T19:39:52.318Z]  INFO: [STREAM] START STREAM - Num Segments: 0
[2022-01-30T19:39:52.319Z]  INFO: Stream Opened for client admin for audiobook stream.opus with streamId str_x2ylnd63nqiat70e3r
[2022-01-30T19:39:52.330Z]  INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/str_x2ylnd63nqiat70e3r/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 0 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/str_x2ylnd63nqiat70e3r/output-%d.ts /metadata/streams/str_x2ylnd63nqiat70e3r/final-output.m3u8
[2022-01-30T19:39:52.331Z]  INFO: 
[2022-01-30T19:39:52.357Z]  INFO: [concat @ 0x7f106c6f6640] Line 2: invalid duration 'null'
[2022-01-30T19:39:52.357Z]  INFO: /metadata/streams/str_x2ylnd63nqiat70e3r/files.txt: Invalid argument
[2022-01-30T19:39:52.360Z]  INFO: 
[2022-01-30T19:39:52.360Z] ERROR: Ffmpeg Err "ffmpeg exited with code 1: /metadata/streams/str_x2ylnd63nqiat70e3r/files.txt: Invalid argument
[2022-01-30T19:39:52.360Z]  INFO: Closing Stream str_x2ylnd63nqiat70e3r
[2022-01-30T19:39:52.361Z]  INFO: Deleted session data /metadata/streams/str_x2ylnd63nqiat70e3r
@alfureu commented on GitHub (Jan 30, 2022): I have a weird issue. The files are in `.opus` format, and whenever I trigger the playback, I get the following error: ![image](https://user-images.githubusercontent.com/10846169/151714840-ce5effcf-2a09-41b0-95b5-e2dfc5e4a562.png) The files play perfectly in VLC. The logs show the following: ``` [2022-01-30T19:39:52.316Z] INFO: [StreamManager] Open Stream Request aAHr7H2t2-bSEeiNAAAO ab_vn5z25oma0uj2mlxd5 [2022-01-30T19:39:52.316Z] INFO: Closing client stream first str_o9lvzmhkqx1u2hce5c [2022-01-30T19:39:52.316Z] INFO: Closing Stream str_o9lvzmhkqx1u2hce5c [2022-01-30T19:39:52.317Z] INFO: Deleted session data /metadata/streams/str_o9lvzmhkqx1u2hce5c [2022-01-30T19:39:52.318Z] INFO: [STREAM] START STREAM - Num Segments: 0 [2022-01-30T19:39:52.319Z] INFO: Stream Opened for client admin for audiobook stream.opus with streamId str_x2ylnd63nqiat70e3r [2022-01-30T19:39:52.330Z] INFO: [INFO] FFMPEG transcoding started with command: ffmpeg -seek_timestamp 1 -f concat -safe 0 -i /metadata/streams/str_x2ylnd63nqiat70e3r/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 0 -hls_playlist_type vod -hls_list_size 0 -hls_allow_cache 0 -hls_segment_filename /metadata/streams/str_x2ylnd63nqiat70e3r/output-%d.ts /metadata/streams/str_x2ylnd63nqiat70e3r/final-output.m3u8 [2022-01-30T19:39:52.331Z] INFO: [2022-01-30T19:39:52.357Z] INFO: [concat @ 0x7f106c6f6640] Line 2: invalid duration 'null' [2022-01-30T19:39:52.357Z] INFO: /metadata/streams/str_x2ylnd63nqiat70e3r/files.txt: Invalid argument [2022-01-30T19:39:52.360Z] INFO: [2022-01-30T19:39:52.360Z] ERROR: Ffmpeg Err "ffmpeg exited with code 1: /metadata/streams/str_x2ylnd63nqiat70e3r/files.txt: Invalid argument [2022-01-30T19:39:52.360Z] INFO: Closing Stream str_x2ylnd63nqiat70e3r [2022-01-30T19:39:52.361Z] INFO: Deleted session data /metadata/streams/str_x2ylnd63nqiat70e3r ```
Author
Owner

@advplyr commented on GitHub (Jan 30, 2022):

Looks like the track duration never got set when the audio file was scanned. If you go to the manage tracks page you can check the file size and duration that was probed for each track.
Let me know what you see there.
image

@advplyr commented on GitHub (Jan 30, 2022): Looks like the track duration never got set when the audio file was scanned. If you go to the manage tracks page you can check the file size and duration that was probed for each track. Let me know what you see there. ![image](https://user-images.githubusercontent.com/67830747/151715577-33441239-7de2-49ee-a163-18988ac363ae.png)
Author
Owner

@alfureu commented on GitHub (Jan 30, 2022):

Yup, I think you are correct, screenshot below:
image

How can one fix this?

@alfureu commented on GitHub (Jan 30, 2022): Yup, I think you are correct, screenshot below: ![image](https://user-images.githubusercontent.com/10846169/151718920-66e46653-c3ae-4aec-8d37-34f57d78be08.png) How can one fix this?
Author
Owner

@advplyr commented on GitHub (Jan 30, 2022):

Do you have a lot of audio files like this? That file is not properly encoded and will need to be re-encoded.
There may be some free tools online to convert your opus files to mp3 or something. Although they may complain about the metadata also.
Or if you have ffmpeg installed you can use ffmpeg to encode them.

@advplyr commented on GitHub (Jan 30, 2022): Do you have a lot of audio files like this? That file is not properly encoded and will need to be re-encoded. There may be some free tools online to convert your opus files to mp3 or something. Although they may complain about the metadata also. Or if you have ffmpeg installed you can use ffmpeg to encode them.
Author
Owner

@alfureu commented on GitHub (Jan 30, 2022):

Hm, I got these from youtube, and used ffmpeg (with yt-dlp) to encode into opus to save space. I will try to get them again. Is there a preferred format overall for audiobookshelf? I wonder whether the issue is due to opus...

@alfureu commented on GitHub (Jan 30, 2022): Hm, I got these from youtube, and used ffmpeg (with yt-dlp) to encode into opus to save space. I will try to get them again. Is there a preferred format overall for audiobookshelf? I wonder whether the issue is due to opus...
Author
Owner

@advplyr commented on GitHub (Jan 30, 2022):

I tested with opus and it was fine because the metadata was encoded properly.
No matter the audio file you use, if it doesnt have the duration set then it isn't going to work.

@advplyr commented on GitHub (Jan 30, 2022): I tested with opus and it was fine because the metadata was encoded properly. No matter the audio file you use, if it doesnt have the duration set then it isn't going to work.
Author
Owner

@alfureu commented on GitHub (Jan 31, 2022):

I tested again downloading the same url with the same command:

  • yt-dlp --embed-thumbnail --embed-metadata --extract-audio --audio-format=mp3 --progress [URL] works without problem
  • yt-dlp --embed-thumbnail --embed-metadata --extract-audio --audio-format=opus --progress [URL] does not work

what is strange is that even if I use the switch --no-embed-metadata with opus, it shows the very same error. I do not know whether this is an opus issue, or a yt-dlp issue, or an audiobookshelf issue

@alfureu commented on GitHub (Jan 31, 2022): I tested again downloading the same url with the same command: - `yt-dlp --embed-thumbnail --embed-metadata --extract-audio --audio-format=mp3 --progress [URL]` works without problem - `yt-dlp --embed-thumbnail --embed-metadata --extract-audio --audio-format=opus --progress [URL]` does not work what is strange is that even if I use the switch `--no-embed-metadata` with opus, it shows the very same error. I do not know whether this is an opus issue, or a yt-dlp issue, or an audiobookshelf issue
Author
Owner

@advplyr commented on GitHub (Jan 31, 2022):

If the audio file does not have a duration set in the metadata, then it is not an audiobookshelf issue.
It seems to me like it is an issue with yt-dlp since that is doing the encoding.

@advplyr commented on GitHub (Jan 31, 2022): If the audio file does not have a duration set in the metadata, then it is not an audiobookshelf issue. It seems to me like it is an issue with yt-dlp since that is doing the encoding.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#41