如何解决视频上的水印反应原生
我正在尝试使用 react-native-ffmpeg
库在视频上添加水印。
使用 react-native-camera
可以录制视频,完成后,我需要为该视频添加水印(图像、文本)。
下面的代码片段:
const recordVideo = async () => {
if (Platform.OS === "android" && !(await hasAndroidPermission())) {
return;
}
if (this.camera) {
const data = await this.camera.recordAsync()
const textCommand = `-y -i ${data.uri} -vf drawtext="text='My watermark': fontcolor=white: fontsize=24: x=320: y=320" -c:a copy /path-to/output2.mp4`
data.uri && RNFFmpeg.execute(textCommand).then(result => console.log(`FFmpeg process exited with rc=${result}.`))
}
}
但是,每次命令都会失败。 textCommand
是写错了还是别的什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。