NextPVR Forums

Full Version: FFMPEG CPU usage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On my Linux box I have two recordings going. One is an NHRA race and the other is an MLB game. When observing the CPU usage I noticed that it seemed quite high. Using Webmin I looked at the processes running and noticed with the NHRA recording, ffmpeg was much higher than the MLB recording. According to Webmin the NHRA event ffmpeg was using 77% CPU usage. But the MLB game ffmpeg was only using 11%.

The NHRA recording is using the Tablo tuner and the MLB game is using an HDHR Connect tuner.

Here are gui pics of the processes for each recording.

So, my question is, why is ffmpeg CPU usage so much higher on the NHRA recording?
Thumb extraction is not using h/w transcoding so assuming they are both 1080i or 720p, and the same bit rate, which may not be true, I would assume your PC cannot transcode h264 as efficiently as mpeg2video.

Martin
(2023-07-30, 09:28 PM)mvallevand Wrote: [ -> ]Thumb extraction is not using h/w transcoding so assuming they are both 1080i or 720p, and the same bit rate, which may not be true, I would assume your PC cannot transcode h264 as efficiently as mpeg2video.

Martin
Thanks for the reply.

I'll have to keep this in mind when recording multiple shows using the Tablo.
I recorded a FIFA match and while I don't use parallel or post processing I use queued processing for quiet time so I get 100% CPU without impacting other things and it does take me notably more time to generate thumbnails and timing from 720p h264 HDPVR vs 1080i mpeg2video OTA (44 minutes vs 26)

Code:
2023-08-01 04:51:38.051    [INFO][1]    Processing 27313 /home/martin/recordings/FIFA Womens World Cup 2023/FIFA Womens World Cup 2023_20230731_05450800.ts
2023-08-01 05:35:44.638    [DEBUG][1]    Process stdout

2023-08-01 05:35:44.886    [INFO][1]    Processing 27314 /home/martin/recordings/FIFA Womens World Cup 2023/FIFA Womens World Cup 2023_20230731_05450800-0.ts
2023-08-01 06:01:50.469    [DEBUG][1]    Process stdout

Over 1 hours of 100% CPU use is pretty intense in general.

Martin
What processor is that on?
This is my extremely low-end AMD A9-9430 For normal NextPVR use it servers me will even with comskip, and VAAPI based transcoding for the web server, but for thumbnail/timing generation it is probably not a good choice at all. My graphic card might do mmjpeg in h/w but I never got it to work.

My point to VCR58 was really to highlight how much more CPU intensive h264 source files could be.

Martin
For really low end devices, it's probably just worth disabling thumbnails.

If you want to try ffmpeg with hardware decode though, and it seems to helps, I could certainly take a look at integrating something like this.
It's not low speed like a RPi but I agree I should be disabling thumbnails, primarily because I don't really need them for how I watch. That and the fact I have had two short thumbnail files which were not seekable with thumbs.

On topic, regardless of the processor h264 will be more CPU intensive because of the math involved, comskip h264 was always slow too but there were some optimizations in donator mode to work better in post processing.

Martin
(2023-08-01, 05:52 PM)sub Wrote: [ -> ]For really low end devices, it's probably just worth disabling thumbnails.

If you want to try ffmpeg with hardware decode though, and it seems to helps, I could certainly take a look at integrating something like this.

If it is possible using HW decode to generate thumbnails would be worth a try.

I had NextPVR installed on my Openmediavault NAS which has a i3 9100 3.6GHz desktop CPU, so there were no issues with CPU usage. I'm working towards separating the NAS and NextPVR server sending the recordings to an NFS share. This has worked well so far but the devices I have for the NextPVR server aren't as good.

The CPU performance data was from a Zotac i3-4010U CPU @ 1.70GHz. I also have a re-purposed Thinkpad i5-4210U CPU @ 1.70GHz which is a little better and what is being used for NextPVR currently. It also has an on board Nvidia GPU. Nvidia-detect output is...
Code:
Detected NVIDIA GPUs:
04:00.0 3D controller [0302]: NVIDIA Corporation GM108M [GeForce 840M] [10de:1341] (rev a2)
Checking card:  NVIDIA Corporation GM108M [GeForce 840M] (rev a2)

Don't know if it could be used at all but it's there.

Since the current generation of intel CPU's is 12+ maybe it's time for an upgrade Big Grin There seems to be plenty of good options for less than $200