FAQ  •  Register  •  Login

High ffmpeg CPU usage

<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Sun Sep 21, 2014 4:50 pm

High ffmpeg CPU usage

Hello,

I have a question regarding High ffmpeg CPU usage.

My Configuration:

Intel i7 920 2.67Ghz - 16GB RAM
Windows 7 64-bit OS SP1
Serviio 1.4.1.2
ffmpeg (ffmpeg-20140919-git-33c752b-win64)
Movies MKV (H264) format

I have Sony SMP-N100 - which requires Transcoding (ffmpeg) when streaming
I am testing out ROKU 3 (4200x) - which supports DLNA MKV (H264)

I have noted that when streaming to the ROKU using Serviio:

1) High ffmpeg CPU usage (98+%) regardless of whether I enable / disable "Transcoding". I did not expect any need for "Transcoding".
2) I had read up in the forum about the high ffmpeg CPU usage and followed the suggestion to download the latest ffmpeg (64-bit) but problem not resolved: still high CPU usage
3) Continued High ffmpeg CPU usage even when I stop Streaming the Video. Only way is to End the ffmpeg process (Ending Serviio process does not kill the ffmpeg process)

I streamed to the ROKU using a different DLNA server:
1) Minimal CPU usage (less than 10% peak) and the DLNA server does not report any Transcoding going on.

I MUCH Prefer using Serviio.

Am I configuring something wrong?
<<

atc98092

User avatar

DLNA master

Posts: 5213

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Sep 22, 2014 12:02 am

Re: High ffmpeg CPU usage

I know the Roku 3 has more power that the 2 XS I have, but I can't stream H264 MKV files without transcoding because the Roku is constantly buffering. It can't handle the video bitrate. I am puzzled why it is transcoding even with the checkbox cleared.

Another way to try it without transcoding is using the Generic profile. To my understanding, this profile transcodes nothing. Might be worth a shot.
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 Mon Sep 22, 2014 9:06 am

Re: High ffmpeg CPU usage

Also check your subtitle settings. Enabling burning in of subtitles may be force transcoding even when off.
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.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Mon Sep 22, 2014 4:49 pm

Re: High ffmpeg CPU usage

abc / denny,

Thanks for the replies.

But as you can see in my discussion above, it does not seem the Roku 3 is the issue. I used another DLNA server and that DLNA just stream the file to the Roku 3 and there was no transcoding and CPU usage was minimal (see above). The Roku 3 did not do any buffering at all with my MKVs (going through the same Hub wired). The Roku 3 also handled the MKV fine when I put them on USB Drive.

I will try and turn off the Subtitle and test it out and see if that made a difference - BTW these movies had No subtitle that I was streaming though I do have some with subtitles.

Does anyone know about the issue with ffmpeg still running even when the Video Streaming had stopped. Only way for me to turn it off without Forced Process Ending is to stream an audio (mp3) through Serviio before the ffmpeg would stop running.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Mon Sep 22, 2014 5:49 pm

Re: High ffmpeg CPU usage

denny,

It seems that If I disable Subtitles, then the file would be streamed to the Roku without any Transcoding. But I have issues with this.

Majority of my MKVs (98%) do NOT have Subtitles. So why is Serviio Transcoding when there are No Subtitles in the MKV?

I want to leave the Subtitle enabled because I do have a few Foreign MKVs that do have subtitles in them (NOT already burned into the Video).

Now I have to Force End ffmpeg in order to regain my CPU. My Previous trick no longer works... :(
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Sep 23, 2014 3:08 am

Re: High ffmpeg CPU usage

If you turn off Transcoding, and turn on Burning-in of subtitles - then you are correct, it shouldn't be firing up ffmpeg for files with no subtitles (ensure also that you have not enabled "extract embedded subtitles").

To help us assist, post a detailed log of you playing a file with subtitles and one wthout and let see if that sheds any light on what is happening.

ps. does the Roku support playing MKV files with subtitles (either embedded or external) natively?
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.
<<

atc98092

User avatar

DLNA master

Posts: 5213

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Tue Sep 23, 2014 12:27 pm

Re: High ffmpeg CPU usage

DenyAll wrote:...
ps. does the Roku support playing MKV files with subtitles (either embedded or external) natively?


DenyAll, according to Roku, they've been able to view subtitles, but I never have. I think the issue (for me) is I may not have any movies with subtitles that can be played without transcoding. All my DVD rips are in MKV, but of course the video codec is MPEG2, and the only Roku that will play that is the Roku TV (I believe that is a Roku player built into a TV, not a separate box). The few MP4 files I have either don't have subs or again have MPEG2 video. The Roku will not play captions from a Blu-Ray rip. Of course, my Sony boxes won't either unless they are ripped to M2TS. If they are MKV, the Sony can see there is a caption track, and I can select it, but it doesn't show the captions.

I'll have to try using Handbrake to convert one of my DVD rips to H264 video, keep the caption track, and save it to both MKV and MP4, and see if either/both will work. I'll try that this weekend if I remember :lol:
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
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Tue Sep 23, 2014 3:25 pm

Re: High ffmpeg CPU usage

I apologize if this is a repeat, but it seemed something happened when I first tried to submit the Log Files.

Here is what I have done (streaming to Roku 3):

1) Enabled the "Debug" mode in logging per the posted instructions
2) Set ON - Transcoding & Subtitles (all boxes checked)
3) Played 2 MKVs
a) First MKV has 2 Embedded Subtitles within it. Played for a few minutes, then stopped. Roku 3 saw the Subs but not able to display any.
b) Forced End of ffmpeg via Task Manager - ffmpeg was continuing to run and eating up CPU
c) Second MKV has No subtitles. Played for a few minutes, then stopped.
d) Forced End of ffmpeg (see b)
4) Log file is "Serviio ON - Trans & Sub.log"

5) Set OFF - Transcoding & Subtitles
6) Rebooted the PC
7) Played 2 MKVs
a) Same first MKV w/ 2 subtitles as in (3a). Roku 3 saw the Subs but not able to display any. Stopped after a few minutes
b) ffmpeg was Not running - almost NO CPU power used
c) Same second MKV w/ no subtitle as in (3c).
d) ffmpeg was not running - almost NO CPU power used.
8) Log file is "Serviio OFF - Trans & Sub.log"

I will attach the Log file in a reply following this because it seemed to have caused a problem in my first posting... :?:
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Tue Sep 23, 2014 3:38 pm

Re: High ffmpeg CPU usage

I am not able to attach the log files.

Firefox reports that it is trying to connect / send request to forum.serviio but nothing happens at all.

Are there rules to the file name & length?

The files are only 43MB and 23MB in sizes so it should not be a problem.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Tue Sep 23, 2014 3:59 pm

Re: High ffmpeg CPU usage

Okay, I have tried to remove what I think are useless information from the log files to reduce the sizes.

Guess the files were too big before.
Attachments
Editted_Serviio_OFF-Trans_&_Sub.log
(235.47 KiB) Downloaded 403 times
Editted_Serviio_ON-Trans_&_Sub.log
(208.18 KiB) Downloaded 402 times
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Tue Sep 23, 2014 10:34 pm

Re: High ffmpeg CPU usage

Haven't looked at the logs yet (am on iPhone) but don't we also need the case where Transcoding is Off and Subtitles is On (all three boxes). This is where you'd hope to see the file without subs play natively and the one with subs be transcoded.

How many CPU cores have you assigned to fffmpeg. Try assigning all of them and seeing if that helps CPU usage (won't make it playable I suspect but one step at a time).
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.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Mon Sep 29, 2014 4:48 pm

Re: High ffmpeg CPU usage

DenyAll wrote:Haven't looked at the logs yet (am on iPhone) but don't we also need the case where Transcoding is Off and Subtitles is On (all three boxes). This is where you'd hope to see the file without subs play natively and the one with subs be transcoded.

How many CPU cores have you assigned to fffmpeg. Try assigning all of them and seeing if that helps CPU usage (won't make it playable I suspect but one step at a time).



Hello DenyAll,

I had forgotten about Logging that Scenario (Trans - OFF & Sub - ON). But if I remember correctly, it did not matter: CPU is still consumed with ffmpeg using almost all the CPU (Trans - Off & Sub - ON) regardless if the mkv had subtitles in it or not.

I will run that scenario and capture that Log and post it as soon as I can.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Mon Sep 29, 2014 4:51 pm

Re: High ffmpeg CPU usage

DenyAll,

Forgot - Serviio is set to maximize CPU usage: from a CPU monitor SW, it reported that when ffmpeg is running almost all the CPU cores are running at 100%.
<<

narutoaustx

Streaming enthusiast

Posts: 22

Joined: Thu Feb 09, 2012 10:57 pm

Post Mon Sep 29, 2014 7:40 pm

Re: High ffmpeg CPU usage

DenyAll wrote:Haven't looked at the logs yet (am on iPhone) but don't we also need the case where Transcoding is Off and Subtitles is On (all three boxes). This is where you'd hope to see the file without subs play natively and the one with subs be transcoded.

How many CPU cores have you assigned to fffmpeg. Try assigning all of them and seeing if that helps CPU usage (won't make it playable I suspect but one step at a time).


DenyAll,

Here is the Log File Requested with Transcode - OFF & Subtitles - ON.

1) Set Serviio with Transcode - OFF & Subtitles - ON
2) Set Log to Debug
3) Rebooted the PC
4) Stream to Roku 3 Box
5) MKV with No Subtitles
6) ffmpeg is running and consuming almost 100% of CPU (all 4 cores are running)
7) Stopped the Streaming
8) Forced End Process of ffmpeg to regain CPU
9) Stream to Roku 3 Box
10) MKV with Subtitles - Roku sees available Subs but cannot display (Subtitles are srt files embedded within the mkv)
11) ffmpeg is running and consuming almost 100% of CPU (all 4 cores are running)
12) Stopped the Streaming
13) Forced End Process of ffmpeg to regain CPU

Hope this helps.
Attachments
Editted_Serviio_Trans-OFF_&_Sub-ON.log
(183.42 KiB) Downloaded 419 times

Return to General discussion

Who is online

Users browsing this forum: No registered users and 14 guests

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