Page 1 of 1

Subtitles muxing

PostPosted: Mon May 04, 2020 9:27 pm
by |ZUTI|
Hi.

Well, my old trusty LG died on me and got myself a Philips replacement. God behold, this one does not support streaming srt subs via DLNA if sub is not in the movie file itself... Proper.

Anyhow, solution is rather simple but tedious:
  Code:
ffmpeg -i movie_in.mp4 -i subtitles.srt -c copy -disposition:s:0 default -metadata:s:s:0 language=English movie_out.mkv


or cleaner:
  Code:
ffmpeg -i movie_in.mp4 -i subtitles.srt -c copy movie_out.mkv


Has to be MKV for Philips as, well, in mp4 it does not work at all.

So, request or question... is there any chance this could be made automatic by, say, profile property? For instance, since this is known for Philips there could be a flag in the profile that would indicate to first run above command on files and then stream that file. But don't know if that is possible, i ques it should be since serviio is the one that is sending the bytes to the tv. But I really am not familiar with inner workings of DLNA protocol.

I can always make a script that will transform my complete library :D

Re: Subtitles muxing

PostPosted: Mon May 04, 2020 10:41 pm
by atc98092
I'm not certain that can be done on the fly. Zip would have to weigh in on that. But Serviio does have the option to burn the SRT subfile into the stream. The issue with that of course is that forces transcoding on all files, and you can't select/deselect the captions.

Re: Subtitles muxing

PostPosted: Tue May 05, 2020 12:00 pm
by |ZUTI|
Hey.

Yes, when I enable that option, files are no longer being played. Sorry for not mentioning this before, but that was what I tried first, once I saw there are no subs :)

Well, like I said, there is always the option that I just make an simple app that does the conversion if it's not possible or too much hassle.

Thanks.

PS: Just to make sure, with "on the fly" we are talking executing command and then playing resulting video file.

Re: Subtitles muxing

PostPosted: Tue May 05, 2020 1:37 pm
by atc98092
Yes, the term "on the fly" means that Serviio does something only when requested by the player. Transcoding is done on the fly, and there are only certain methods that are available in that manner. For example, you cannot transcode into the MP4 container on the fly. That is something that has to be done prior to streaming. I can't say if your desired feature is possible in that manner. Only Zip can say for sure. He maintains a Bitbucket site for Serviio problems or feature requests. You could post your request there as well. https://bitbucket.org/xnejp03/serviio/issues

Re: Subtitles muxing

PostPosted: Tue May 05, 2020 4:15 pm
by |ZUTI|
Thanks, why not :)