appas 8 Posted April 6 Posted April 6 Hey, I am writing to request playback support for module files (.mod, .xm, .it, etc). Currently, Emby tries to play these but fails. There are several C# .NET libraries for mod playback, eg. SharpMik: https://github.com/thegouldfish/SharpMik I would be interested in fulfilling this need as a plugin, but I did not find any information on how to get the currently playing audio stream into a plugin. If someone can help me with this, then maybe I will be able to write a plugin for this purpose. Or are playback decoder plugins even possible? Alternatively, please tell me how to have Emby ignore module files in folders marked as Music. As I said, currently, mod files in my music folders get an attempted play, that results in an error message. I would primarily like to fix this error message by having a plugin that provides the playback capabilities, but if that's not possible, I would like at least to be able to avoid the error messages, which also stop playback! For reference, attached is the error I'm getting. 1 1
Luke 42505 Posted April 6 Posted April 6 Quote As I said, currently, mod files in my music folders get an attempted play, that results in an error message Hi there, let's look at an example. Please attach the information requested in how to report a media playback issue. Thanks!
appas 8 Posted April 7 Author Posted April 7 Ok, so here is a log of trying to play an IT (Impulse Tracker) file in the latest Linux server (4.9.3). Emby (correctly) identifies it as music, so files of this type in a music library get attempted plays, but there is failure because there isn't actually a valid decoder available. I would be willing to contribute such a decoder (as a .NET plugin), but I would need some guidance on how to do that. None of the plugin APIs I found deliver audio streams to the plugin to handle. embyserver.txt
visproduction 360 Posted April 7 Posted April 7 Of interest: IT file definition: https://docs.fileformat.com/audio/it/
Luke 42505 Posted April 7 Posted April 7 We'll just disable support for the .it extension for now. Support for it will need to be added to the server ffmpeg build before they will work.
appas 8 Posted April 7 Author Posted April 7 I understand if you do not want to commit resources to developing support for tracker modules (such as IT, and also MOD, XM, etc), but as I said, I would be willing to do that work for you, if you only helped me understand how. I'm thinking that since Emby supports .NET plug-ins, I should be able to write my own decoder, where I could use something like the mentioned SharpMik, or LibOpenMPT.NET ( https://github.com/Xpl0itR/LibOpenMPT.NET ) for decoding. So, there are ready-made implementations for the heavy lifting of actual decoding and playback, but what I would need to know is how to get the audio buffer from Emby into the plugin..?
Luke 42505 Posted April 7 Posted April 7 It's not that kind of work. It's a matter of getting support for these files compiled into the server ffmpeg build. 1
appas 8 Posted April 7 Author Posted April 7 So it is not possible to write a custom decoder plugin? The plugin API does not support that?
appas 8 Posted April 7 Author Posted April 7 If going the ffmpeg route, I found this: https://stackoverflow.com/questions/39520849/ffmpeg-loading-tracker-files It seems there is already support in ffmpeg (probably why ffprobe recognizes them!), and it should be a simple matter of recompilation with the lib. 1
Luke 42505 Posted April 7 Posted April 7 26 minutes ago, appas said: So it is not possible to write a custom decoder plugin? The plugin API does not support that? You can't really hook an emby plugin into ffmpeg. ffmpeg is what does the raw decoding work, not emby server. 1
appas 8 Posted May 21 Author Posted May 21 Hey, So, I noticed there was a new version of Emby available, 4.9.5.0, which I installed. However, there is still no support for module playback. Is this feature on the roadmap? I am sincerely asking for its implementation, as it seems to be a simple matter of a compile-time flag for ffmpeg, and it would really be useful for me, as much of my music library is in tracker formats.
appas 8 Posted May 21 Author Posted May 21 (edited) Wait, could I do this myself? I thought Emby has the ffmepg library somehow "baked in", like I think Jellyfin does, but AI is trying to convince me that Emby uses the system ffmpeg, so, I've compiled ffmpeg myself, with the libopenmpt and libmodplug libraries linked. I then restarted the Emby server, but modules still don't work. I did try to find actual documentation about this, but came up short. AI claimed that I should manually set the ffmpeg path, but I don't think that's true, because I've installed the compiled ffmpeg to /usr/local/bin/ffmpeg , which I believe is the default location, and anyway, the path in the settings tree it told me was hallucinated, or no longer valid. Please instruct me on how to get this version of ffmpeg (with module support) to be used by Emby. It does seem as if the ffmpeg in the system path has successfully replaced with a version with this needed support, as attempting to play an IT file with ffmpeg -i gives Input #0, libopenmpt, from '/media/opendrive/backup/Seagate8T/Music/pahamoka/DDREAMIN.IT': Metadata: title : Daydreaming encoder : Impulse Tracker 2.14p2` etc. Edited May 21 by appas
Luke 42505 Posted May 22 Posted May 22 Hi, it's something we will have to add to our ffmpeg build. Quote Please instruct me on how to get this version of ffmpeg (with module support) to be used by Emby. This isn't something we are actively testing so I don't have ready made instructions for you. The diagnostics plugin has an option to set a path to a different ffmpeg build, if I recall.
yocker 1577 Posted May 22 Posted May 22 @appasIf by mod you mean the old Amiga mods then i would love that as well. Old Amiga nerd so have a soft spot for a lot of the music from the Amiga.
appas 8 Posted May 22 Author Posted May 22 8 hours ago, Luke said: Hi, it's something we will have to add to our ffmpeg build. Ok, well I can report that compiling ffmpeg with flags --enable-libopenmpt --enable-libmodplug yields a version that can open these files. 8 hours ago, Luke said: The diagnostics plugin has an option to set a path to a different ffmpeg build, if I recall. Can you please help me do that? I could not find the Diagnostics Plugin in the Plugin Catalog; closest was Emby Statistics Plugin, which seems like a different thing. Also, https://mediabrowser.github.io/Emby.DiagnosticsPlugin/ says "The diagnostic options are volatile and not being saved anywhere". Will this also apply to the ffmpeg path? If so, that would mean I'd need to set it on each restart of Emby. 1 hour ago, yocker said: @appasIf by mod you mean the old Amiga mods then i would love that as well. Old Amiga nerd so have a soft spot for a lot of the music from the Amiga. Yes, that's exactly what this is about! I have a lot of tracker music from back in the day, from sites like Trax in Space and so on... I'm glad to hear this would be useful to others, as well! 1 1
Luke 42505 Posted May 22 Posted May 22 Quote Also, https://mediabrowser.github.io/Emby.DiagnosticsPlugin/ says "The diagnostic options are volatile and not being saved anywhere". Will this also apply to the ffmpeg path? If so, that would mean I'd need to set it on each restart of Emby. Yes that is correct.
appas 8 Posted May 22 Author Posted May 22 7 minutes ago, Luke said: Yes that is correct. Well, can you still help me find and install the Diagnostics Plugin, if this will let me choose the ffmpeg used by Emby?
Luke 42505 Posted May 22 Posted May 22 1 minute ago, appas said: Well, can you still help me find and install the Diagnostics Plugin, if this will let me choose the ffmpeg used by Emby? Have you explored the plugin catalog?
appas 8 Posted May 22 Author Posted May 22 Yes, I already told you I did: 5 hours ago, appas said: I could not find the Diagnostics Plugin in the Plugin Catalog; closest was Emby Statistics Plugin, which seems like a different thing. I also tried a search engine and the linked forums thread, but did not find where to get the actual plugin, nor how to install it.
appas 8 Posted May 22 Author Posted May 22 4 minutes ago, Luke said: It's called Emby Diagnostics. It's in there. Ah, I'm sorry, I found it now. Well, I installed the plugin, and changed ffmpeg to Quote /usr/local/bin/ffmpeg which is what is output when I run "which ffmpeg". But, I am still getting "No compatible streams" trying to play module files, even though ffmpeg from the command line can open them.
appas 8 Posted May 22 Author Posted May 22 I had a look in the logs, and there was Quote Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb So I tried to replace /opt/emby-server/bin/ffmpeg and /ffprobe with the ones I compiled myself, but it did not help: I'm still getting "No compatible streams" for tracker modules.
Luke 42505 Posted May 22 Posted May 22 19 minutes ago, appas said: Ah, I'm sorry, I found it now. Well, I installed the plugin, and changed ffmpeg to which is what is output when I run "which ffmpeg". But, I am still getting "No compatible streams" trying to play module files, even though ffmpeg from the command line can open them. If it generated an ffmpeg log then that will help you confirm if your build was used or not.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now