jjm2473 / ffmpeg-rk

支持rockchip mpp硬件加速编解码的ffmpeg版本。Forked ffmpeg that supports rkmpp decodeing, encoding and rga scaling
https://ffmpeg.org
Other
178 stars 31 forks source link

RK3588转码时需要添加水印,使用filter drawtext时报错 #35

Closed xiamuran1 closed 8 months ago

xiamuran1 commented 9 months ago

使用命令: ./ffmpeg -i rtsp://admin:abc123abc123@192.168.100.80 -vf "drawtext=text='112233445566':fontfile=/usr/share/fonts/truetype/aenigma/lucid2.ttf:fontsize=64:x=500:y=500:fontcolor=red,scale_rga=w=1280:h=720" -c:v h264_rkmpp -q:v 80 -f matroska -f rtsp -rtsp_transport tcp rtsp://192.168.100.236/live/test1 报错信息: Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Error while processing the decoded data for stream #0:0 Conversion failed! 请教下这个问题怎么解决?

mtdxc commented 8 months ago

To enable compilation of this filter, you need to configure FFmpeg with --enable-libfreetype and --enable-libharfbuzz. To enable default font fallback and the font option you need to configure FFmpeg with --enable-libfontconfig. To enable the text_shaping option, you need to configure FFmpeg with --enable-libfribidi. drawtext的说明好像是要enable-freetype,这个ffmpeg没打开这些选项,得重新编译下源码吧

xiamuran1 commented 8 months ago

编译ffmpeg的时候,--enable-freetype选项加了的,不加这个选项drawtext直接用不了 我已经找到解决办法了,rkmpp编码器其实是有加水印功能的(将MppEncOSDData数据设置到frame的meta就可以),只是这份源码没有实现,需要自己添加; 直接使用编码器的OSD不太通用,如果只加水印编码器的够用了,如果硬解码后还需要再cpu上做其他操作然后再硬编那这个问题就绕不开了