Page 1 of 1

Allow audio track switching by TV

PostPosted: Sat Aug 02, 2014 6:33 pm
by MarkusW
Serviio is great, but unfortunately the feature of allowing audio track selection on the TV is still not implemented.

I have realized now, that all that is needed to be changed, is the command "-map 0:1" in the parameter list to ffmpeg (where the 1 stands for the first audio track).
By changing it to "-map 0:a", ALL audio tracks are automatically included, so that one can switch the audio track with the TV!

I suppose, that most modern TVs support this feature. I can only tell, that it works really well on my 2010 Sony TV, which has a rather poor DLNA support in general...

I would really appreciate this feature a lot! I guess, that the "-map 0:a" option should also work for TVs, that dont allow audio track selection. (I suppose they will just use the first audio track - like before).

So, my hope is that this could be really easy and quick to implement. It would maybe be just one letter in the source code.

Re: Allow audio track switching by TV

PostPosted: Sun Aug 03, 2014 4:24 pm
by patters
It's been an open ticket for a long time, but I agree it's the most needed enhancement to Serviio:

I think the reason it hasn't yet been implemented is that it's actually a pretty complex issue. Especially now that subtitle support is thrown into the mix.
viewtopic.php?f=11&t=6688&p=48290#p48290

Re: Allow audio track switching by TV

PostPosted: Sun Aug 03, 2014 10:46 pm
by MarkusW
Thanks for your answer.

But I think, the suggestion I gave isn't complex at all.
The audio track switching works anyway nice for videos, which are not transcoded. I can easily switch the audio track with the remote of my TV.

It just needs to be fixed for the transcoded videos.
At the moment, only the first audio track is included to the transcoded video (because ffmpeg is called with "-map 0:1").
By calling ffmpeg with "-map 0:a", all audio tracks are included, hence one can switch them with the TV remote. At least that works with my Sony 2010 TV ;) and the latest ffmpeg release. This method should also be independent of subtitles.

Of course, later one could implement also a more complex solution, for TVs which dont allow audio track switching.

But for now, this should be a quick solution for many users. And in the end, also the best solution, since one can change the language directly during watching (which I like to do sometimes, eg. rewind and watch a scene again with the original language).

Maybe zip can give some feedback on this. I might also be missing a point, and the issue is more complicated, but I think that the "-map 0:a" option should really do the job and solve this issue.

Re: Allow audio track switching by TV

PostPosted: Thu Aug 07, 2014 7:59 pm
by zip
This might be a quick win for you, but we have to take into account:

- that the other tracks are often encoded using different codecs, so this would be useless (if the other codec cannot be played by the TV)
- not all TVs support client-side audio switching
- I might do some 'magic' to show subtitles when the preferred audio is not the user's language - so some logic is required there
- and probably something I forgot

Re: Allow audio track switching by TV

PostPosted: Thu Aug 14, 2014 1:01 pm
by Wixie
At least it would be nice if you can set serviio to prefer a specific language not always the first one.

Re: Allow audio track switching by TV

PostPosted: Sat Aug 16, 2014 2:47 pm
by thenamelessthing
please work on this issue !!!! :!:

Re: Allow audio track switching by TV

PostPosted: Sat Aug 16, 2014 4:14 pm
by MarkusW
Wixie wrote:At least it would be nice if you can set serviio to prefer a specific language not always the first one.

I strongly support this request ;) In the simplest version, one should be able to tell serviio: Use audio track No. x (if availible), where x is directly the number of the audio track. This would be one checkbox and a text field in the GUI. In addition, there should be a option to include all audio tracks, as I have already proposed.
This would then help all users quickly and easy.
A more fancy version of this feature can always be added later. But I would prefer to have a quick & dirty solution soon, rather than wait some more years for the fancy solution.

Re: Allow audio track switching by TV

PostPosted: Sat Aug 16, 2014 4:27 pm
by thenamelessthing
I agree with MarkusW

Re: Allow audio track switching by TV

PostPosted: Wed Sep 10, 2014 2:30 pm
by MarkusW
Hi again, I have finally managed to de-compile the source code, and make the small change myself. (If I have understood it correctly, de-compiling should be okay for personal usage)

ffmpeg is now always called with the "-map 0:a" option.
I have tested that now for two weeks, and it works flawlessly. I can now switch the audio track with the remote of my Sony Bravia TV. Great! :)

Up to now, all files which I have tested have worked, I have not encountered any problems yet.

Re: Allow audio track switching by TV

PostPosted: Wed Sep 10, 2014 3:05 pm
by thenamelessthing
Wow! Great news! I'm REALLY REALLY REALLY interested by that! Can you give me the step to do the same thing

Re: Allow audio track switching by TV

PostPosted: Wed Sep 10, 2014 10:13 pm
by atc98092
It would be very interesting to see how it might work on my Panasonic TV, which has almost everything transcoded. My Sony players play most native, and I can select audio tracks with ease.

I doubt there's anything in the Roku that would support multiple audio tracks, though. They have a toggle for captions, but of course transcoding removes those tracks from the stream. Might be worth the Roku developers to work this into it somehow, if they knew this was possible. I'm part of their beta group, so can at least bring it up. Of course, this has to be included within the standard Serviio install before they'd likely even consider it.

Re: Allow audio track switching by TV

PostPosted: Sun Sep 14, 2014 2:52 pm
by MarkusW
Unfortunately, I didn't know anything about de-compiling, so it was mainly a trial-and-error approach ;)
But I hope I can recall the steps somehow:

1. Decompile all .jar files from F:\Programme\Serviio\lib .
I have used jd-gui. There, you can click "Save all sources" to get .zip files with the source code.
2. Unpack those .zip files in a new folder.
3. Setup a project in Eclipse, I think there is an option that eclipse checks the source folder structure, and creates the project automatically.

Then, you can try to recompile it (Project->Build All). I had lots of compilation errors, but the file which is important (org\serviio\external\FFMPEGWrapper.java), was compiled anyhow into bin\org\serviio\external\FFMPEGWrapper.class

Maybe you can check first if this works, before changing something in the source code.

I hope it is ok to post this stuff here.

Re: Allow audio track switching by TV

PostPosted: Fri Jun 17, 2016 2:43 pm
by JohnleouF
Bonjour,

Je suis français et quelques lacunes pour traduire l'anglais.

Je suis très intéressé par votre méthode de décompilation. J'ai moi même une tv Samsung (UE55C7700) et je ne peux pas changer la langue depuis la telecommande. J'ai quelques films qui sont en anglais en 1ere langue donc coincé.
J'ai bien réussi les étapes 1 et 2 mais je bloque à l’étape 3. J'ai installé le logiciel Eclipse mais je ne comprend pas comment créer un projet. Quel fichier faut-il choisir ?


Pour résumer :

1. Decompile all .jar files from F:\Programme\Serviio\lib . ==> OK
I have used jd-gui. There, you can click "Save all sources" to get .zip files with the source code.
2. Unpack those .zip files in a new folder. ==> OK
3. Setup a project in Eclipse, I think there is an option that eclipse checks the source folder structure, and creates the project automatically. ==> Quel fichier prendre ? Pouvez vous approfondir svp ?


Merci beaucoup de votre soutien.

Re: Allow audio track switching by TV

PostPosted: Sun Jun 19, 2016 6:51 pm
by zip
This is coming in 1.7

Re: Allow audio track switching by TV

PostPosted: Tue Jun 21, 2016 7:32 am
by JohnleouF
zip wrote:This is coming in 1.7



Oh yeahhhhh !

Avez-vous une date approximative de sortie de cette version 2.7 ?
Je suis super impatient !!

Cela va en ravir plus d'un je pense :)


Encore merci pour votre boulot et votre réponse très rapide