我使用电子(你可以认为它是nodejs)来制作一个播放加密视频的播放器。使用下面的代码,我可以对视频进行加密
主管( ffmpeg -i "${file}" -encryption_scheme cenc-aes-ctr -encryption_key ${encryptionKey} -encryption_kid ${encryptionKey} "${pathWithoutExtension}".CONVERTED.${extension} )
使用这个命令我可以在播放视频的同时
exec(
`ffplay "${fileFullPath}" -decryption_key ${encryptionKey} `,
(error) => {
console.log(error)
}
)我的问题是:如何在播放时间内向视频中添加文本水印,并结合解密工作添加文本水印。我尝试了这个命令,但是它没有work.it添加水印,但是解密不起作用
( ffplay "${fileFullPath}" -vf "drawtext=text='Place text here':x=10:y=H-th-10: fontfile=/path/to/font.ttf:fontsize=12:fontcolor=white: shadowcolor=black:shadowx=5:shadowy=5", -decryption_key ${encryptionKey},(错误) => {console.log(错误)})
发布于 2022-01-13 10:41:19
最终找到解决方案:此命令将文本水印添加到加密文件中,并在播放时间显示。
exec( `ffplay "${fileFullPath}" -decryption_key ${encryptionKey} -vf
drawtext=fontfile='c\:/Windows/Fonts/Arial.ttf':text='Place text here'
:fontsize=48:x=100:y=100"`,
(error) => {
console.log(error)
}
)https://stackoverflow.com/questions/70648783
复制相似问题