[FFmpeg-user] ffmpeg ip cam stream with drawtext

Moritz Barsnick barsnick at gmx.net
Wed Jan 30 12:05:19 EET 2019

On Wed, Jan 30, 2019 at 07:47:24 +0100, frhun wrote:
> so I try lot of ffmpeg switch
> ffmpeg -r 25 -rtsp_transport tcp -i 
> rtsp://admin:1234@ -c:v libx264 -b:v 2M 
> -c:a copy -vf "[in]drawtext=fontfile='C\:\\Windows\\Fonts\\cour.ttf': 
> textfile='Z\:\\k\\v\\T_A\\P.txt': x=180: y=30: reload=1: 
> fontcolor=black: fontsize=50: box=1: boxborderw=5: boxcolor=red at 0.8 , 
> drawtext=fontfile='C\:\\Windows\\Fonts\\cour.ttf': 
> textfile='Z\:\\k\\v\\T_A\\F.txt': x=180: y=75: reload=1: 
> fontcolor=black: fontsize=50: box=1: boxborderw=5: boxcolor=white at 0.8 , 
> drawtext=fontfile='C\:\\Windows\\Fonts\\cour.ttf': 
> textfile='Z\:\\k\\v\\T_A\\O.txt': x=30: y=30: reload=1: fontcolor=black: 
> fontsize=60: box=1: boxborderw=5: boxcolor=aqua at 0.8 , 
> drawtext=fontfile='C\:\\Windows\\Fonts\\cour.ttf': 
> textfile='Z\:\\k\\v\\T_A\\M.txt': x=30: y=80: reload=1: fontcolor=black: 
> fontsize=47: box=1: boxborderw=5: boxcolor=yellow at 0.8[out]" -preset 
> ultrafast -f flv rtmp://a.rtmp.youtube.com/live2/x-x-x-x
> I fixed the rate, and the output bitrate , and -preset utltrafast set
> cpu usage 50% down to 20% it is better but not enough
> because i using 4 cameras, processor usage ~80% , I cooked my notebook...
> How to go below cpu usage

How does this performance change if you omit all the filters, i.e. just
RTSP demuxing/decoding and re-encoding to YouTube? (In other words: Do
the filters "cook" your CPU, or is it the encoding?) Not with "-c:v
copy, as in your original e-mail.

If the encoding is the bottleneck, you should try using your GPU for


More information about the ffmpeg-user mailing list