CPU Usage

  • Wonder about the CPU usage.
    I have a 1640 x 1232 h264 stream and the Monitor stream is set to Base64, the same resolution and watch only.
    That htop output is without having Shinobi open in a browser.

    alt text

    What is ffmpeg doing if the stream just needs to be shown 1:1 (no format conversion)?
    Even just recording to HDD should not stress the CPU?

  • I've just run the "top" command on my ubuntu server to compare with your result.

    Running a single 1920x1080 h264 stream set to HLS copy and recording .mp4 copy with motion detection.

    Same %cpu ~90% from ffmpeg.

    The ubuntu server is running as virtual machine on windows 10, when viewing CPU usage in windows it was "only" 20%

    The top command show cpu percentage from each core, added all together.
    shift + i toggles a normal cpu % view.

    I didn't know this before now 🙂
    Is this the case with your result too ?

  • Is your 20% in the Hyper-V manager?

    I have Ubuntu Server running on a dedicated Hyper-V Server (no GUI).
    It has a i3 that workes well for running pfSense, Debian web server, 1x Windows 8 and FreeSWITCH (PBX).

    Figuring out CPU usage on VMs is confusing.
    With shift+i i get ~50%
    Hyper-V Manager says ~6%

    I know people have Ubiquiti UniFi Video running with 6 cams on Intel Atoms.
    Also the cheap DVRs you can buy do not have a powerful CPU.

    My main concern is the power bill with the kWh price we have here in Germany.
    The less CPU usage the less power is used.

    I made a quick test:
    ~20.5W just pfSense VM running (IDLE after 10 min)
    ~27-33W just pfSense VM running and doing a internet speedtest in Firefox
    ~24W Shinobi running and streaming to Shinobi dashboard plus popup open (Base64, watch only)

  • Hmm, something happened and the cpu usage is so low..

    I have now added 2 more cameras.

    3 x 1920x1080 Stream: HLS copy Recording: .mp4 copy Motion: Delete motionless video
    Intel i3-8100

    Shift + i applied
       PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
     25824 lasse     20   0  983812  97516  30936 S  1.4  2.4   0:54.33 ffmpeg
     25728 lasse     20   0  983132  92804  30824 S  1.1  2.3   0:40.99 ffmpeg
     27980 lasse     20   0  983472  94040  30952 S  1.1  2.3   0:08.26 ffmpeg
      1658 lasse     20   0  931512  53492  22548 S  0.1  1.3   0:11.04 PM2 v2.9.1+
      1731 lasse     20   0 1250708 102488  23748 S  0.1  2.5   0:23.00 node /home+
     22538 root      20   0       0      0      0 S  0.1  0.0   0:00.56 kworker/u2+

    Hyper-V states 4 % cpu

    What i have change recently:
    After fresh install and 2-3 reboot, the shinobi dashboard could not load in browser.
    pm2 list Showed Camera.js memory usage raised to 1.5gb and restarted over and over.
    syslog showed that access to mysql was not gained with IP "192.168.XXX.XXX" same as eth0 static ip of the server on local network.
    So i change the mysql user Majesticflame @ localhost --> any host and everything worked as normal.
    I doubt this lowered my cpu usage, but i have no explanation for that.


Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.