七牛 avconcat视频拼接无效?

新手上路,请多包涵

请帮我看看,我的需求是音视频合并,试了无数次,都高不成功,文档也写的不详细,请给指导一下。
已经差多官方文档,但是写的很模糊,解决问题全靠猜

async combineVideoAndAudio(videoKey, audioKey, targetKey, pipeline) {

    //已经上传到bucket
    const videoUrl = `${videoKey}`;//01z001d15tddduokaj00mtsczd0023hi.mp4
    const audioUrl = `${audioKey}`;//01z001d15tddduokaj00mtsczd0023he.mp4
    
    const videoUrlSafeBase64 = qiniu.util.urlsafeBase64Encode(videoUrl);
    const audioUrlSafeBase64 = qiniu.util.urlsafeBase64Encode(audioUrl);
    const saveasKey = qiniu.util.urlsafeBase64Encode(`${targetKey}`);

    const fops = `avconcat/1/format/mp4/${videoUrlSafeBase64}/${audioUrlSafeBase64}`;

    try {
        const result = await this.executePfop(this.bucket, videoKey, encodeURIComponent(fops), pipeline);
        if (result.statusCode === 200) {
            return `http://${this.domain}/${targetKey}`;
        } else {
            throw new Error(`Failed to combine video and audio: ${result.statusCode}, ${JSON.stringify(result)}`);
        }
    } catch (error) {
        throw error;
    }
}
阅读 226
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
七牛云问答
子站问答
访问
宣传栏