Page 1 of 1

CPU Usage Optimization on Ubuntu

PostPosted: Thu Sep 27, 2012 3:20 am
by zigz14
Hello,

I've been able to piece together many of the guides around regarding installing and configuring on Ubuntu (mostly a Linux/Ubuntu newbie) and I've got it working well for the most part.

However, I seem to be running into a limitation with my CPU. Everytime I play an MKV (HD specifically) and some HD videos (mp4's 1080p mostly), it begins to stutter.

My limitation seems to be the CPU (Intel D525). When running an HD video, my CPU shows 100% usage in top, taken up mostly by ffmpeg (95-99%). I've downloaded ServiiDroid as a console since my Ubuntu install is headless (12.04.1 Server, x86). I am able to add and remove shared folders and have tried to add a second CPU under the ServiiDroid->Advancded->Transcoding Settings->CPU Cores, but it does't seem to be taking effect. When I view top while watching videos over SubSonic, my CPU usage goes well over 100% when transcoding. However, my CPU usage when viewing videos via Serviio never goes over 100%.

Other small details: the files are being accessed on an mdadm RAID5 with excellent performance, Ubuntu and Serviio are installed on a USB 2.0 8 GB thumb drive, system RAM is 4.0 GB DDR3, all network connections are 1 Gbps.

Please let me know if you have an suggestions, thank you.

Re: CPU Usage Optimization on Ubuntu

PostPosted: Thu Sep 27, 2012 7:10 am
by will
Which devices are you streaming to as that is very imprortant as it determines if the video can be delivered natively (no cpu overhead), re-packaged into a different container (not ver expensive), or fully transcoded (expensive)? Most target video codecs support using multiple cores, but some only support 1.

I have the same CPU and noticed an improvement with SSSE3 enabled which let me just transcode to 720p in real time, however, I've had problems with the latest ffmpeg trunk, so try it with the last stable build as a base. I haven't spent to much time investigating though as most of the time my mkvs are just re-packaged into mpegts so it doesn't require that much cpu time.

Re: CPU Usage Optimization on Ubuntu

PostPosted: Fri Sep 28, 2012 7:19 pm
by zigz14
The end device is going to a XBOX 360 connected to a TV via composite cable (older TV).

How do I enable SSE3? viewtopic.php?f=14&t=6931&start=0 ? haven't read through it all, but it seems to be the post that tackles the question.

Thanks for the feedback.

Re: CPU Usage Optimization on Ubuntu

PostPosted: Fri Sep 28, 2012 7:58 pm
by will
On phone so limited reply, just add the enable option when you run configure.

Re: CPU Usage Optimization on Ubuntu

PostPosted: Sat Sep 29, 2012 10:23 am
by zip
XBox profile transcodes to wmv which only supports 1 CPU core.

Re: CPU Usage Optimization on Ubuntu

PostPosted: Mon Oct 22, 2012 5:23 am
by robertsearle
The cpu always goes to 100% when transcoding regardless of what CPU you have. It tries to transcode the entire file all at once. There may or may not be a problem.

  • The easiest thing to do is turn the logging up to DEBUG.
  • Search the serviio log file for the exact ffmpeg command
  • Run the command but put a
      Code:
    time ffmpeg XXXXXXXXXXXX
    in front of it
  • Run it for around 30 seconds

Press Ctrl-C and stop the operation after 30 seconds. See how much of the file is actually processed. My *hope* is more than 30 seconds of video has been processed. Assuming more than 30 seconds has been processed, its probably not your server.

Q: Again, the file is written to tmp drive. Is that your USB thumb drive?

Q: Is it wireless or wired?

Q: I assume you are down-grading the video to less than 1080p. I am not sure if xbox handles 720p or less?