2021-05-25
作者:互联网
FMPEG硬件转码常用的几个命令
最近常用FMFPEG转码, 下面分享一下常用的几个命令
1. intel qsv 转码rtmp, 输出图像大小640x480 , 音频 AAC, 码率600Kbps
./ffmpeg -hwaccel qsv -c:v h264_qsv -i "http://192.168.1.1:9981/stream/channelid/825559690?ticket=fd725f4d1382e400f0cae4d8f4e1e13abedd1a41&profile=pass" \
-acodec aac -ar 44100 -strict -2 -ac 2 -vf 'vpp_qsv=framerate=25,scale_qsv=w=640:h=480' -c:v h264_qsv -profile:v main -preset medium -g 10 -bf 1 -async_depth 1 -r 25.0 -b:v 600k -f flv rtmp://192.168.1.109:1935/live/CCTV12-HD
2. 因为intel QSV解码MPEG2 图像会花,用VAAP解码就不会, 下面用VAAPI解码, QSV编码, 再叠加上文字
./ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i "udp://236.78.78.1:59045" -vf "drawtext=fontsize=160:text='%{localtime\:%T}',scale_vaapi=640:480,hwmap=derive_device=qsv,format=qsv" -acodec aac -ar 44100 -strict -2 -ac 2 -c:v h264_qsv -profile:v main -preset medium -g 10 -bf 1 -cavlc 1 -look_ahead 0 -async_depth 1 -r 25.0 -b:v 600k -f flv rtmp://192.168.1.109:1935/live/sztv1
3. VAAPi解码, VAAPI编码
./ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i "http://192.168.1.109:9981/stream/channelid/772929163?ticket=f18376dc4732f3aa29d49d78f215ea4b717bfe78&profile=pass" -acodec aac -ar 44100 -strict -2 -ac 2 -vf 'fps=25,scale_vaapi=w=640:h=480:format=nv12' -c:v h264_vaapi -profile 578 -level 30 -bf 0 -b:v 600k -maxrate 600k -f flv rtmp://192.168.1.109:1935/live/sztv2
标签:profile,25,05,format,192.168,vaapi,2021,hwaccel,qsv 来源: https://blog.csdn.net/u010147871/article/details/117249061