VTEncoderXPCService CPU Usage

Channels at rest:
https://www.dropbox.com/s/lhyz6rh05cex97c/Channels%20at%20rest.png?dl=0

Channels with hardware decoding:
https://www.dropbox.com/s/a1lbzglzaldeej8/Channels%20hardware%20decoding.png?dl=0

Channels with software decoding:
https://www.dropbox.com/s/bwajya2ex8o4ek7/Channels%20Software%20decoding.png?dl=0

MacPro Early 2008 spec
https://www.dropbox.com/s/f64h9irfn9w4dmi/MacPro%202008.png?dl=0

Thanks. Looks like overall CPU usage is still on 60% even though it says the encoder is using 400%

What does the CPU field on the DVR’s Settings tab say?

https://www.dropbox.com/s/00rl5vi9mgzpcco/CPU%20Settings.png?dl=0

Okay it looks like that CPU does not support QuickSync, so hardware encoding is not possible. The DVR should not be showing the hardware option- that is a bug.

as an IBM Mainframe System Programmer, I love finding bugs. Helps developers in resolving issues before production.

1 Like

This is fixed in v2017.02.22.0443. Thanks for reporting.

I seem to be having similar issue here. Just recently over the last week or so maybe, I have very high CPU usage for VTEncoderXPCService. Just for a single video playing through web view I am getting over 300% and up to 400%. I have macOS Sierra 10.12.6 on a 2.3QC 2012 Mac Mini with 16GB Memory and SSD with library stored on an external USB 3.0 HDD. Doesn't matter if I have the Setting for quality lowest or highest and it is set to hardware encode.

I am not sure but it also seems that this is causing the playback to buffer as the encoding cannot keep up maybe? I can’t remember where to get logs from if you let me know I will post those asap. It is 1220am EST and I will be hitting the sack in about 1 hr. So if I miss you then I will respond tomorrow.

Hmm, this could happpen if something else was the Hardware transcoder like Remote Desktop. You could switch to software transcoding instead, or reboot and see if it fixes itself.

Could you explain more about if it was something else? I will switch to software and see what happens. I believe I have eliminated any other software that it could be by shutting everything down except channels Web playback and it would be the only thing running and also stop if I stop channels playback. I have also restart a few times as well. I’ll update more with software transcoding results.

Open Terminal and run this command:

curl -XPOST http://127.0.0.1:8089/hls/hwaccel

Then copy/paste the new “HWE” message that show up on the Log tab.

The only thing that comes up is true on the next line right in front of the next line's Command Prompt. Sorry if I am not understanding what to do here.

I also can now no longer playback in web due to this issue...

As soon as I play a video, at the bottom it just says transcoder finished and then spins for a while and then errors with what you see there.

Plex is running right now but CPU usage is as you see here...

Actually... digging a little more. My Channels Folder of media is magically empty. In this picture you can see that the Channels folder is selected and there is nothing in there. This drive is 5TB. There is nothing in the trash.

I don't know WHAT is going on.

You need to check the Log tab of the DVR. It should show some “HWE” messages after you run the Terminal command. It will also show error messages about why playback is not working.

It sounds like your DVR drive got disconnected or is failing.

Ok after hyperventilating a little and restarting twice, the media came back up.

Here is what I got from running that command in the Channels Log…

2018/02/01 21:19:39 [HWE] Trying /Users/Scott/channels-dvr/latest/ffmpeg /Users/Scott/channels-dvr/latest/ffmpeg -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_videotoolbox -profile:v high -level 4.2 -realtime 1 -f null -y /dev/null
[Parsed_color_0 @ 0x7f8587d01e40] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_videotoolbox))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x7f8587c032e0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
Output #0, null, to ‘/dev/null’:
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (h264_videotoolbox), 1 reference frame, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 h264_videotoolbox
[h264_videotoolbox @ 0x7f8589828a00] Color range not set for yuv420p. Using MPEG range.
No more output streams to write to, finishing.
frame= 3 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=1.93x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (/dev/null):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (225 bytes);
Total: 3 packets (225 bytes) muxed
2018/02/01 21:20:59 [HWE] Trying /Users/Scott/channels-dvr/latest/ffmpeg /Users/Scott/channels-dvr/latest/ffmpeg -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_videotoolbox -profile:v high -level 4.2 -realtime 1 -f null -y /dev/null
[Parsed_color_0 @ 0x7ffc3be07660] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_videotoolbox))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x7ffc3bf00300] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
Output #0, null, to ‘/dev/null’:
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (h264_videotoolbox), 1 reference frame, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc57.89.100 h264_videotoolbox
[h264_videotoolbox @ 0x7ffc3c829a00] Color range not set for yuv420p. Using MPEG range.
No more output streams to write to, finishing.
frame= 3 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.12 bitrate=N/A speed=1.41x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (color=black:640x480):
Input stream #0:0 (video): 4 packets read (1843200 bytes); 4 frames decoded;
Total: 4 packets (1843200 bytes) demuxed
Output file #0 (/dev/null):
Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (225 bytes);
Total: 3 packets (225 bytes) muxed
2018/02/01 21:21:28 [HLS] Starting transcoder for file1611-ip1 at 0s from ::1 (encoder=h264_videotoolbox, resolution=720, deinterlacer=blend, bitrate=6000)
[mpegts @ 0x7fe3e6808000] Dropped corrupted packet (stream = 2)
2018/02/01 21:21:34 [HWE] Trying /Users/Scott/channels-dvr/latest/ffmpeg /Users/Scott/channels-dvr/latest/ffmpeg -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -c:v h264_videotoolbox -profile:v high -level 4.2 -realtime 1 -f null -y /dev/null
[Parsed_color_0 @ 0x7fc750407540] size:640x480 rate:25/1 duration:-1.000000 sar:1/1
Input #0, lavfi, from ‘color=black:640x480’:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_videotoolbox))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 0x7fc75040a660] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_videotoolbox @ 0x7fc751829a00] Error: cannot create compression session: -12915
[h264_videotoolbox @ 0x7fc751829a00] Try -allow_sw 1. The hardware encoder may be busy, or not supported.
Error initializing output stream 0:0 – Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
2018/02/01 21:21:34 [HWE] Failure: exit status 1

For some reason macOS is reporting that the hardware encoder is not available.

Did you install the DVR as a system service so it boots before you login?

I honestly am not sure if I did intentionally, but this is what I have for Channels/SiliconDust in startups

In ~/Library/LaunchAgents I have com.getchannels.dvr.plist

In /Library/LaunchDaemons
com.silicondust.dvr.plist

Nothing in LaunchAgents and nothing in StartupItems in that same /Library

Nothing in /System/Library in any of the startup folders.

It has worked properly up until about 1 week or so ago and then noticed the fans running and CPU high and then started investigating. I cannot think of any updates that I have done in the last 2 weeks in macOS.

LaunchAgents look normal.

I’ll have to investigate to see if there’s a way to list everything using the hardware decoder…

1 Like

“I’ll have to investigate to see if there’s a way to list everything using the hardware decoder”

Were you able to find a terminal command or something that lists this out by chance? Curious to know. The issue has happened once since posting this and Channcels was the only thing running with that kind of demand. But only that once and that was over a week ago.