FAQ  •  Register  •  Login

High CPU use

<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Thu May 11, 2017 11:00 am

High CPU use

Hello:

I'm triying to use Serviio with a Philips TV model 46PFL9704 as DLNA client. I can install and configure Serviio in a laptop with an Intel i3 CPU and lastest version of Linux Mint 64bits.

The problem comes when I try to play any of my movies on the TV. I can see the files and start to reproduce, they play perfectly for about 10 seconds, but then the video begins to lags, stop and start, jump, etc. Monitoring the CPU I see a very high use (90%) by the FFmpeg process, and it no stop when I stop to play the video, I need to manually kill the process.

Things that I tried: differents video files and formats, version of Serviio, profiles for the TV, LAN or WIFI connections, compiled the FFmpge for my Linux.

Is not enough powerfull an i3 to transcoding? Can I enable the Nvidia GPU (520) to transcode? Can any one help, please?

Thanks.
<<

atc98092

User avatar

DLNA master

Posts: 5212

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Thu May 11, 2017 12:13 pm

Re: High CPU use

FFMPEG continues to transcode the file until either a) the file is completely transcoded, or b) a different file is selected to play. It's normal for it to continue is you only stop playback.

FFMPEG will usually run at close to 100% regardless of the CPU you have. It just takes whatever is available. I would expect an i3 to be capable of handling the transcoding, but we would need additional information. What is the media info for the video file (video and audio codec), and what Serviio profile is selected? Perhaps the file doesn't really need to be transcoded, and a different profile might help. You could try using the Generic profile, which transcodes nothing, and see what will play and what won't.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Thu May 11, 2017 2:13 pm

Re: High CPU use

I'm trying a lot of different files, but for testing I usually try with a movie with this metadata:

Video Resolution 1080p
Duración 1:37:03
Bitrate 10121 kbps
Width 1920
Height 1080
Aspect Ratio 1.78
Container MKV

Codec H264
Bitrate 8137 kbps
Idioma Español
Bit Depth 8
Height 1080
Width 1920

Codec AC3
Canales 5.1
Bitrate 448 kbps
Sampling Rate 48000 Hz

I tried with the 3 diferents Philips profiles that comes integrated in Serviio. The best one for me is Phillips 2009, with the others ones, my TV do not reproduce almost anything. With Philips 2009 the TV can read every file and start to play it perfectly. I also tried with the generic profile, but then the TV cannot play anything but some avi files.

Thanks.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Fri May 12, 2017 6:38 pm

Re: High CPU use

An update:

I tried to save the temp file that is generated during the transcode process. Then copy this file to the shared folder and play it as a normal file. The TV can play it PERFECT, so I think the transcode process works fine and creates the correct file.

If the transcoded file is correct and the TV can play it when is not need to transcode again, I think that during the transcode process must be some resource that is being maxed out. I 'm monitoring the system and cannot find anything wrong, the RAM, CPU and hard disk appears to have enough margin to work fine.

Can be some kind of video memory buffer or something like that? Any idea?

Thanks.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sat May 13, 2017 1:37 am

Re: High CPU use

I also tried with the generic profile, but then the TV cannot play anything but some avi files.
For the files that it does play, do they play perfectly, or do you experience the same issues?

Check that you have sufficient available space on the temporary drive (the drive where your transcoded files are created) and that the disk is error free.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Sat May 13, 2017 10:24 am

Re: High CPU use

Hello:
With the generic profile those avi file plays perfectly.

My hard disk drive have more than 100GB of free space and a check disk did not find any problem. I have only one drive, do I need a secondary drive to create the transcoded file?

I'm doing tests with other servers like LXiMedia Server and do not have this issue (they have tons of others problems, so I always return to Serviio, is the best one) but it can transcode and send the files to the TV without lag. So I think this must be a software problem, not hardware.

I also installed Serviio in other machine with W10 and a SSD drive, with same results.

Thanks.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sun May 14, 2017 8:38 am

Re: High CPU use

Tough one. Stuttering like you are describing can be caused by a number of factors, so it's a matter of trying different things.

Some things to try (in order):

  • Turn off all sub-title options and test
  • Try the Panasonic 2010 Profile with your MKV file and test
If neither of the above help
  • Switch back to the Phillip 2009 profile.
  • Turn on detailed logging and restart your PC
  • In the log file find the ffmpeg command that is being run and copy it
  • Turn off detailed logging and restart your PC. This will stop any ffmpeg processes running.
  • Now in the command line run the ffmpeg command from above and note the rate that frames are being encoded.
  • Post both that command line and the encoding rate
ps. you can have a single drive, no problems there.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Tue May 16, 2017 9:55 am

Re: High CPU use

I tried the follow:
.-Format Linux, fresh install W7 with drivers, updates, etc..... same issues.
.-Changed the ffmpge bin in the Serviio install folder with one downloaded from https://ffmpeg.zeranoe.com, that is compiled with NVIDIA GPU support. The ffmpeg CPU use drop from aprox. 95% to aprox 85%, so I think is working. But that did not help me. But can help people with slower CPU's.
.-Install Serviio in my gaming PC with i7, 32GB, dual SSD in RAID, powerfull GPU, etc. Same problems.
.-Reinstall Linux and try with ALL the profiles and deactivating all options that can use any extra resources. Nothing help. The Panasonic profile works like the Philips 2009, play files but a lot of lag.

The only thing that really helps is add the "maxVBitrate" option in the profile, but I need to use a very low value (2440), anything above that cause again lagging and stuttering. With that option, I can play the files but the image quality is very very bad.

I don't know what else can I do.
Is there any option similar to Bit Rate but less impact on image quality?
Do you have any other idea?

I will do the test and post the logs as soon as I can. Thanks for your help.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Tue May 16, 2017 3:39 pm

Re: High CPU use

I did what you told me, and the results are:

.-If I run the ffmpge from command line:

ffmpeg -threads 0 -i /home/raulito/Vídeos/Buscando a Dory.mkv -y -threads 0 -c:v mpeg2video -pix_fmt yuv420p -qscale:v 3 -r 24000/1001 -g 15 -c:a:0 copy -map 0:0 -map 0:1 -sn -f vob /tmp/Serviio/transcoding-temp-6eebb16dc89e84cf1681a72c256ef2ff.stf

The system return and error: cant find file "Buscando", so I need to rename the file to only "Buscando", then it worked. I dont know if this a big problem or not.

When renamed the file and run the command, those are the results:

frame= 563 fps= 61 q=3.0 size= 32010kB time=00:00:23.77 bitrate=11029.0kbits/
frame= 592 fps= 61 q=3.0 size= 34244kB time=00:00:25.15 bitrate=11153.3kbits/
frame= 621 fps= 61 q=3.0 size= 37192kB time=00:00:26.14 bitrate=11653.8kbits/
frame= 651 fps= 61 q=3.0 size= 40114kB time=00:00:27.48 bitrate=11954.8kbits/
frame= 685 fps= 61 q=3.0 size= 42488kB time=00:00:28.99 bitrate=12005.4kbits/
[vob @ 0x3a46d40] buffer underflow st=0 bufi=233568 size=238891ate=8586.4kbits/s speed=3.13x
[vob @ 0x3a46d40] packet too large, ignoring buffer limits to mux it
[vob @ 0x3a46d40] buffer underflow st=0 bufi=233568 size=238891
[vob @ 0x3a46d40] buffer underflow st=0 bufi=235592 size=238891
[vob @ 0x3a46d40] packet too large, ignoring buffer limits to mux it
[vob @ 0x3a46d40] buffer underflow st=0 bufi=235592 size=238891
[vob @ 0x3a46d40] buffer underflow st=0 bufi=237616 size=238891
[vob @ 0x3a46d40] packet too large, ignoring buffer limits to mux it
[vob @ 0x3a46d40] buffer underflow st=0 bufi=237616 size=238891

frame= 2069 fps= 62 q=3.0 Lsize= 114680kB time=00:01:26.59 bitrate=10849.3kbits/s speed=2.61x
video:108531kB audio:4737kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.246077%
Exiting normally, received signal 2

The vob lines are in red and are in sync with freeze problem on the TV

In the complete exit I also saw this:

VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size

Looks like I have some problematic buffer!!

I have all the command line exit in a TXT if you need it. Thanks
<<

atc98092

User avatar

DLNA master

Posts: 5212

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Wed May 17, 2017 11:58 am

Re: High CPU use

Just an FYI. As you discovered, file paths and/or names that contain spaces will not work as is. You need to enclose the full file path/name in quotes and then it will work.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Wed May 17, 2017 1:45 pm

Re: High CPU use

Of course, that is what I did. That is not a big problem.

The big one is the vob buffer errors.

Thanks.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Thu May 18, 2017 9:24 am

Re: High CPU use

back from travelling....
It's going to be trial and error I'm afraid. Try the following:

Test 1
In the Phillips 2009 profile, change the line
<Video targetContainer="mpeg" targetACodec="ac3" targetVCodec="mpeg2video" DAR="16:9">
to
<Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="mpeg2video" DAR="16:9">

Save and restart your PC. Do the same test (copy the ffmpeg command and run it separately - see if those VOB errors are there). The aim of this is to see whether changing containers remove the VOB write errors.

Test 2
In the Phillips 2009 profile, change the line
<Video targetContainer="mpeg" targetACodec="ac3" targetVCodec="mpeg2video" DAR="16:9">
to
<Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="h264" DAR="16:9">

Save and restart your PC. Do the same test. Using H264 should lower the bitrate (at the expense of using more processing power to encode). Your findings regarding bitrate didn't make sense to me - you had said earlier that if you copy the transcoded file to your library (presumably renaming it to .mpeg) it played without an error, yet the bitrate of that file would have been as high? Anyway give it a try and let's see.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Thu May 18, 2017 10:58 am

Re: High CPU use

Hello:

Both options have same behavior. The Ffmpge command works perfect, no "VBV buffer size not set" and no "buffer underflow" errors. And the temp file is perfectly playable on VLC.

Extract :

frame=48807 fps=555 q=-1.0 size= 2235631kB time=00:33:55.68 bitrate=8996.6kbits/frame=49260 fps=557 q=-1.0 size= 2256144kB time=00:34:14.52 bitrate=8995.9kbits/frame=49601 fps=557 q=-1.0 size= 2272688kB time=00:34:28.96 bitrate=8998.7kbits/frame=49608 fps=554 q=-1.0 size= 2272926kB time=00:34:29.02 bitrate=8999.3kbits/frame=49923 fps=554 q=-1.0 size= 2288631kB time=00:34:42.24 bitrate=9004.0kbits/frame=49935 fps=554 q=-1.0 Lsize= 2289742kB time=00:34:42.68 bitrate=9006.4kbits/s speed=23.1x
video:2001535kB audio:113899kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.239832%
Exiting normally, received signal 2.

But the TV do not play anything with both options, not the original file and not the transcoded temp one. I can navigate and see the files, but when I try to play it I get only a blank screen, no exit or error.
<<

atc98092

User avatar

DLNA master

Posts: 5212

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Thu May 18, 2017 11:49 am

Re: High CPU use

I have one caution about testing with VLC. That player will play just about anything :D , so just because it works in VLC isn't a perfect test for other players. VLC is just about a dog gone near perfect player for your computer. Too bad they don't have versions for most set top boxes. It would be fantastic if they had a Roku version. :D
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Sun May 21, 2017 9:02 am

Re: High CPU use

Well it appears your TV doesn't like transcoding to a mpeg-ts container.

The Phillips 2009 profile is set (before any of the above changes) to transcode to a mpeg-ps container. The VOB errors are I believe unique to that container type.

Can you try:

ffmpeg -threads 0 -i "/home/raulito/Vídeos/Buscando a Dory.mkv" -y -threads 0 -c:v mpeg2video -pix_fmt yuv420p -target dvd -qscale:v 3 -r 24000/1001 -g 15 -c:a:0 copy -map 0:0 -map 0:1 -sn -f vob /tmp/Serviio/transcoding-temp-6eebb16dc89e84cf1681a72c256ef2ff.stf

as that should set the correct buffer size. See if it removes the errors (and check whether the resultant file plays).
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Mon May 22, 2017 8:44 am

Re: High CPU use

Hello:

Your command works perfectly. In the first run it returns an error of Could not determine norm (PAL/NTSC/NTSC-Film) for target. so I need to add the -pal dvd prefix. Then it works fine, no errors on the command line and the file works fine on the TV.

I'm doing some test converting the test file to other formats. I think that the problem is the REAL compatibility of the TV, is very limited, a lot of combinations of codecs and bitrates that are listed on the manual as compatible does not work.

I have found that the best settings for me is converting to .mp4 h264 720p 7000kbps and AAC 192kbps. With those settings the TV can play all the files without errors and enough quality for me.

Can you help me to add this settings to the Serviio profile? I'm trying to do it, but is too much for me.

Or do you think is better add your -target dvd? If this is the case, can enhance the video resolution to at least 720p?

Many thanks for your interest and help.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon May 22, 2017 12:02 pm

Re: High CPU use

raulrapadura wrote:I have found that the best settings for me is converting to .mp4 h264 720p 7000kbps and AAC 192kbps.
Unfortunately you cannot transcode to an .mp4 container on-the-fly, which is what Serviio would need to do.

As for adding the -target dvd-pal switch to the transcode command - that would be for zip to consider (he would have to program Serviio to add this when transcoding to a mpeg-ps container). If you want to pursue this probably best to raise it as a bitbucket request.

One thing you could do it write your own ffmpeg wrapper to modify the transcode commands (ie. add the -target dvd-pal switch to the executed command yourself) - if you search the forum you will find a number of examples on how to write a wrapper.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

raulrapadura

Serviio newbie

Posts: 10

Joined: Thu May 11, 2017 10:38 am

Post Mon May 22, 2017 12:40 pm

Re: High CPU use

OK, I will try to write my own wrapper and post here, if it works, to help other users with similar TV's.

Many thanks for all your help.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 23 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.