I am no subsonic genius, but I will say that it would be extremely difficult to implement due to how much possibilities mkv's have. Its can be difficult to understand but ill make this as simple as I can and give you a solution to your problem.
Mkv inputs usually have a single video stream, audio steams can be multiple as well as subtitle streams. As well you can but fonts in to the container. Well in order to switch audio as an example your video steam would be video stream 1, then audio steam would be 2, subtitle stream would be 3. This would be a basic mkv file with subtitles. it would select the default or lowest stream first to use. simple and it works.
Well when you add multiple streams to a single container basically it will do the same thing... so you have video stream 1, audio stream 2, audio stream 3, subtitle stream 4, and subtitle stream 5. By default, it will use video stream 1 and audio stream 2....(in most cases)
If this was implemented into subsonic basically the streams would have to be specified to select video stream 1, and audio stream 3. that would play the other audio stream. But what if there is no audio stream 3? like the first example? how would it detect and be implemented into subsonic to detect this problem. That is where the difficulty is mainly. This kind of error could prob show an access denied error in subsonic on your video player. As well you have to account for other containers and such in the end it would prob be best to just not implement this at all.
For subtitles, the problem is similar. As well the fact you have to account for the difficult subtitles to read that is not supported by ffmpeg. As an example ssa/ass subtitles require alot of user side set up in order for ffmpeg to properly work. Then theres the fact that ffmpeg currently cannot add subtitles within a container currently. Then there is sub/idx subtitles, what a pain they can be. Theres another that I cannot quite recall the name right now I think it starts with a p maybe? anyways. The point is there is alot of variables to consider because of how many options mkv's have.
As your solution, you can convert your mkv into multiple files... basically heres the commands...
example abc.mkv it has 2 audio streams and 2 subtitles. (well depending on the subtitle type the command may be different as well as the audio)
- Code: Select all
ffmpeg -i abc.mkv -map 0:0 -map 0:1 abc.mp4
this example will make the video and 2nt audio stream into an mp4.
to extract the subtitles it would be...
- Code: Select all
ffmpeg -i abc.mkv -map 0:3 abc.ass
you could also change it to 0:4 to extract the 2nt subtitle file, or make it abc.srt to make it a standard subtitle file. to stream video, audio and burn in subtitles do.
- Code: Select all
ffmpeg -i abc.mkv -map 0:0 -map 0:2 -vf ass=abc.ass abc.mp4
the example above would burn in ssa/ass subtitles, if its srt do....
- Code: Select all
ffmpeg -i abc.mkv -i abc.srt -map 0:0 -map 0:1 -map 1:0 abc.mp4
So basically what Im trying to say is there are so many different things you can do with mkv's, the possibilities are quite nearly endless. That is what also unfortunately the flaw that makes it difficult for streaming.
ie if you do ffmpeg -i (the file) it will tell you all the information about the file and what streams are where if you decide to do the multiple file route.
I wish you luck and I hope this post was helpful. Also want to note I am not a subsonic dev, and this information is based on what Iv learned and may not be 100% accurate. cheers =D