我有一个命令,它使用 FFmpeg 生成带有背景和文本的视频,并希望使用 Azure Batch Service 渲染它。在本地我的命令有效:
./ffmpeg -f lavfi -i color=c=green:s=854x480:d=7 -vf "[in]drawtext=fontsize=46:fontcolor=White:text=dfdhjf dhjf dhjfh djfh djfh:x=(w-text_w)/2:y=((h-text_h)/2)-48,drawtext=fontsize=46:fontcolor=White:text= djfh djfh djfh djfh djf jdhfdjf hjdfh djfh jd fhdj:x=(w-text_w)/2:y=(h-text_h)/2,drawtext=fontsize=46:fontcolor=White:text=fh:x=(w-text_w)/2:y=((h-text_h)/2)+48[out]" -y StoryA.mp4
而一个使用 C# 以编程方式生成并作为批处理服务返回失败中的任务添加:
cmd /c %AZ_BATCH_APP_PACKAGE_ffmpeg#3.4%\ffmpeg-3.4-win64-static\bin\ffmpeg -f lavfi -i color=c=green:s=854x480:d=7 -vf "[in]drawtext=fontsize=46:fontcolor=White:text=dfdhjf dhjf dhjfh djfh djfh:x=(w-text_w)/2:y=((h-text_h)/2)-48,drawtext=fontsize=46:fontcolor=White:text= djfh djfh djfh djfh djf jdhfdjf hjdfh djfh jd fhdj:x=(w-text_w)/2:y=(h-text_h)/2,drawtext=fontsize=46:fontcolor=White:text=fh:x=(w-text_w)/2:y=((h-text_h)/2)+48[out]" -y StoryA.mp4
ffmpeg 配置有效,池也有效,因为我已经使用具有输入和输出文件的更简单的 ffmpeg 命令对其进行了测试。该命令没有输入文件,也许这是问题的一部分?
谢谢
最佳答案
如果您的 ffmpeg 命令需要您建议的输入文件,则该文件需要是 CloudTask 的一部分。作为 ResourceFile .
这些资源文件应放置在 Azure Blob 存储中。生成一个 SAS URL(具有适当的读取权限和足够的结束时间)并将其用作 ResourceFile 的 BlobSource .
关于azure - FFmpeg 命令在本地工作,但不适用于 Azure Batch Service,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51789652/