Page 1 of 1

Can Serviio remux on playback without reencoding?

PostPosted: Sat Mar 21, 2020 2:37 pm
by chrisw
I have a Samsung MU series TV which is unable to handle any videos with more than a certain number of subtitle streams.

Inevitably, some videos I try to play have over 30 (or 40!) subtitle streams, and the TV always starts to choke with video & audio stuttering and skipping. (The TV can also not decode PGS format subtitles, it only supports SRT.)

I can use mkvtoolnix to remux the files with fewer (or no) subtitle streams, and problematic files then play fine. But this takes a LONG time and is hugely wasteful of disk space.

I'd like to keep English subtitles as we use them for viewing. I don't want to use Serviio ffmpeg transcoding - my Synology isn't powerful enough to transcode 4K HDR H265 on the fly, and ffmpeg seems to have issues transcoding in realtime and also fails to exit cleanly, resulting in all cores at 100% on the NAS until I kill the processes via SSH.

However I'm sure that my NAS would be capable of handling real-time remuxing, sending just a selection of subtitles along with the primary audio and video streams without reencoding, ffmpeg could certainly handle a codec copy and stream map to stdout in real-time.

Such a feature would be amazing to have in Serviio - to be able to configure which audio, video and subtitle streams you want to present to the TV over DLNA, then have Serviio remux and send, without having to create remuxed duplicates of the originals (which, given UHD filesizes, can be huge already). I would definitely buy a Pro licence for that feature. Is there any prospect of this being added as a feature?

Re: Can Serviio remux on playback without reencoding?

PostPosted: Sat Mar 21, 2020 4:26 pm
by atc98092
Yes, a profile can remux instead of transcode. Look at many of the profiles not notice that some sections contain a target Codec and some don't.

For example, a transcoding section that has this on the first line will transcode the video but transmux the audio:

<Video targetContainer="mpegts" targetVCodec="h264" maxVBitrate="12000">

This line will only transmux the video and audio:

<Video targetContainer="mpegts">

This will transmux the video but transcode the audio:

<Video targetContainer="mpegts" targetACodec="aac" aBitrate="128">

However, if the video is only transmuxed, to my knowledge all captions tracks will still be included in the stream. So a simple transmuxing will not help with your captions issues.

I have to include my usual rant about the miserable DLNA support offered on Samsung TVs. I have two different models, and don't even bother using their internal players. I use both Roku players and the Nvidia Shield, and have zero interest in using the Samsung interface. Especially with the Shield, I can play absolutely everything without transcoding at all.

Re: Can Serviio remux on playback without reencoding?

PostPosted: Mon Mar 23, 2020 3:39 pm
by chrisw
Agreed, the Samsung interface is terrible and Serviio is the only DLNA server software I've found which even properly facilitates resume playback properly, so I'm already a fan.

I bought a RPi4 to run OpenELEC, in the hope the updated kernel (to support HDR output on HDMI0) would be released imminently, but it's still not happened. As a result we need to watch any HDR content through Samsung's player though any SDR material is always watched via Kodi. A frustrating disjointed experience. (unless I drag the PC into the living room and play everything in MPC-HC with MadVR :lol: )

I wonder if any of the internal transmux profiles can be customised by altering the serviio config, there must be something somewhere which defines how ffmpeg is being called. I think it's time to have a play...

Re: Can Serviio remux on playback without reencoding?

PostPosted: Mon Mar 23, 2020 4:59 pm
by atc98092
Playing with profiles can be fun and interesting, especially if you're stuck at home right now. :D

I use Kodi with my Nvidia Shield players, and absolutely nothing needs transcoding. My Roku devices do, because of the limited codec/container support. But I learned enough about the profiles to create a bunch of new ones for Roku devices, which are now included in Serviio. Zip absolutely appreciates users that can assist with profile creation/updating.