我正在使用 ffmpeg 编码器在我的Android应用中使用此Library
的帮助渲染图片以下命令用于从图像列表中渲染视频。
String command[] = {"-r","1/5","-i",gpxfile.getAbsolutePath(),"-c:v","libx264","-vf","fps=25","-pix_fmt","yuv420p",root.getAbsolutePath()+"/"+"video.mp4"};
这里的gpxfile是我的文本文件,其中包含以下内容
file '/storage/emulated/0/DCIM/Camera/P_20170807_143916.jpg'
duration 2
file '/storage/emulated/0/DCIM/Pic/P_20170305_142948.jpg'
duration 5
file '/storage/emulated/0/DCIM/Camera/P_20170305_142939.jpg'
duration 6
file '/storage/emulated/0/DCIM/Pic/P_20170305_142818.jpg'
duration 2
我的问题是在运行命令时它使用文件内的TextPaths而不是视频呈现一个像黑屏一样的终端... !!! 任何建议...... ??
这是我的项目Source Code
答案 0 :(得分:0)
将文本文件更改为
npm i -g quicktype
然后编码此命令:
file '/storage/emulated/0/DCIM/Camera/P_20170807_143916.jpg'
duration 2
file '/storage/emulated/0/DCIM/Pic/P_20170305_142948.jpg'
duration 5
file '/storage/emulated/0/DCIM/Camera/P_20170305_142939.jpg'
duration 6
file '/storage/emulated/0/DCIM/Pic/P_20170305_142818.jpg'
duration 2
file '/storage/emulated/0/DCIM/Pic/P_20170305_142818.jpg'
答案 1 :(得分:0)
最后我从Deepak获得了正确的命令。
String command[] = {"-y", "-f", "concat", "-safe", "0", "-i", gpxfile.getAbsolutePath(), "-vsync", "vfr", "-pix_fmt", "yuv420p", root.getAbsolutePath()+"/"+"video.mp4"};