Chain with nginx consuming enormous CPU time?

For the developers that use FFmpeg in their software.
Post Reply
Posts: 1
Joined: Mon Dec 24, 2018 1:08 am

Chain with nginx consuming enormous CPU time?

Post by whytheheckme » Mon Dec 24, 2018 1:20 am


Please forgive my ignorance, I'm very new to ffmpeg. I'm looking to set up a chain where I'm ingesting a video stream with an rtmp nginx server, piping the data to ffmpeg to crop the frame, and then piping it back to another nginx rtmp stream for distribution. I can get data in and out of nginx without a problem, and can get data through ffmpeg (see below), but this simple chain causes ffmpeg to utilize 8 Xeon cores, or a full dual core i7 (with a ~15mbps data stream). This is without any transcoding or other frame modification - in my mind, this pipe should use virtually nothing (similar to the consumption of nginx).

For simplicity, here is ingest using streamlink, piping out to the rtmp server. Effectively the same:

Code: Select all

streamlink -O best | ffmpeg -re -i pipe:0-bsf -f flv rtmp://localhost:1935/live/test
This works, but pegs the CPU.

I also recompiled ffmpeg to support gpu, and tried using

Code: Select all

, but got

Code: Select all

Option hwaccel (use HW accelerated decoding) cannot be applied to output url flv 

I wanted to do this as a benchmark to see how much more resources cropping will use, but I can't conceivably get this running as a straight pipe. I wanted to get 30-40 streams running simultaneously on a 32 core machine - is this crazy?

Thank you!

Post Reply