Page 1 of 1

Transcoding performance issues

PostPosted: Thu May 30, 2013 6:57 pm
by Schelter
Hello,

i'm using a HP N54L Microserver (2,2Ghz Dualcore AMD) as a NAS and UPnP Streaming Server with Serviio. Everything works fine, until it needs to transcode a file. The CPU hit 100% then, and the video stutters. Now i'm wondering if it's possible to tune the transcoding somehow? As I see, lots of people have performance problems with transcoding, but I didn't found a solution so far.
Does anyone have an Idea?

Re: Transcoding performance issues

PostPosted: Thu May 30, 2013 7:41 pm
by weiyentan
We had transcoding performance issues after a period of watching a series of videos.

What I did was to put the transcoding files on a separate physical disk (and that physical disk was an external one that was plugged into modem router (Cisco one)). The transcoding files will be around 1-2 GB tops per device, but that extra disk made a world of difference.

Another thing that could cause stuttering is the network....but in this case it sounds like it could be either CPU or disk. The computer is doing too many things at once.

Re: Transcoding performance issues

PostPosted: Fri May 31, 2013 1:45 am
by DenyAll
Some preliminaries:
  • Firstly make sure you have an up-to-date version of ffmpeg. There have been some improvements in performance in ffmpeg over time;
  • set the number of cores in Serviio console, on the Delivery tab, Transcoding to the maximum you have;
  • Ensure the drive where your temporary transcoded files are stored is a fast drive and has plenty of space;
  • If you don't use subtitles - in Serviio console, on the Delivery tab, Subtitles select Enable Subtitles and disable (uncheck) all other options. The other options are CPU intensive
See how the above goes first.
The only way to really tune transcoding is to avoid it ;) . Depending on your renderer, you can tweak your profile to minimise the amount of transcoding going on. You need to work out what level of transcoding is required for each file type you play. Most of the profiles that come with Serviio are pretty good at doing this - some are better than others - but each can be tweaked depending on the exact model of your TV/renderer. The following are some "rules" to apply when doing this - ranking from least processor intensive to most:

  1. Renderer can play the file natively - do not transcode, stream the file as is. This has lowest CPU usage.
  2. Renderer can handle both video and audio streams, but not the container type - in the profile set rules to remux the video and audio into a new container. This has low CPU usage.
  3. Renderer can handle the video stream, but does not support the audio stream - in the profile set rules to remux the video, and change the audio type to a supported type. This has low - mid CPU usage.
  4. Renderer cannot support the video type - in the profile set rules to transcode the video (and audio if necessary). This has high to extremely high CPU usage.
Only the last case has high CPU usage. It is this type we need to avoid as much as possible.

Where it cannot be avoided, the only choice then is to use an external program to permanently transcode (convert) the video into something your renderer supports (this moves the file from a type 4 to type 1). Plenty of free stuff on the web to do this - I have used XMedia Recode in the past for this, but there's plenty of others.

So a bit of work - people on the forum can assist but give it a go yourself. You'll need to let us know what type of media files you are playing (MediaInfo details) and what your renderers are to help further.

Re: Transcoding performance issues

PostPosted: Fri May 31, 2013 9:00 pm
by Schelter
I've done some tweaks now. The OS and transcoding directory is on a SSD with plenty of space. The movies are on a separe HDD.
I've updated the ffmpeg, the old one was a 32-bit, i've updated it to 64-bit. Set number of cores to 2.
disabled the options in subtitles. played a little with profiles. I think I understand the problem now.
In case 1-3 everything works fine now, with no transcoding CPU is around 8%, in case 2 and 3 CPU goes up to 40%, but everything is still ok.
In case 4, if the video needs to be transcoded, that kills the performance. CPU hits 90-95% then, and playback is not possible - and that look strange to me. I'm running Win 2008 R2 on the machine, and I can play the videos, even in 1080p, perfectly with something around 30-40% CPU usage. why does transcoding need so much more?

Re: Transcoding performance issues

PostPosted: Fri May 31, 2013 10:24 pm
by zip
Decoding (playback) is much less expensive than encoding.

Re: Transcoding performance issues

PostPosted: Sat Jun 01, 2013 12:22 pm
by Schelter
hmmk, so as long as ffmpeg uses CPU instead of GPU, there is no way to speed it up, right? can serviio use ffdshow instead of ffmpeg?