Answer the question
In order to leave comments, you need to log in
Stream resizing with ffmpeg?
Good afternoon! I'm trying to resize a stream from 1280x720 to 720x480
. So I take three rtsp streams from three cameras using ffmpeg and transfer them to the dash and hls folder in two resolutions: 1280x720 and 720x480. total of that 12 streams. And it turns out that the whole thing starts a lot of ffmpeg processes and loads all the i7-3770K CPU @ 3.50GH cores at 100%.
I am attaching an application (nginx) from one stream
application src {
live on;
exec_options on;
exec_static ffmpeg -threads 0 -rtsp_transport tcp -re
-i "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0"
-c copy -f flv -r 25 -bufsize 2M -s 1280x720 -an "rtmp://localhost:1935/hls/camera1 2>>/var/log/nginx/ffmpeg.log"
-c libx264 -f flv -r 25 -bufsize 2M -vf scale=720:480 -an "rtmp://localhost:1935/hls/720pcamera1 2>>/var/log/nginx/ffmpeg.log"
-c copy -f flv -r 25 -bufsize 2M -s 1280x720 -an "rtmp://localhost:1935/dash/camera1 2>>/var/log/nginx/ffmpeg.log"
-c libx264 -f flv -r 25 -bufsize 2M -vf scale=720:480 -an "rtmp://localhost:1935/dash/720pcamera1 2>>/var/log/nginx/ffmpeg.log";
}
Answer the question
In order to leave comments, you need to log in
Moskus correctly hinted at the conversion.
There are few options for fighting: use hardware encoding (for example, Intel QSV, which is available with FFmpeg 2.7.1 or nVidia NVENC, which appeared earlier), which will slightly reduce the load; put up with it or use a farm for encoding (encode the stream on other machines and do a restream).
It is optimal to make a mix of hardware coding and load distribution across the farm.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question