2017-10-13 92 views
0

我使用ffmpeg的编码器来呈现在我的Android应用图片的帮助下创建类似文本视频相反幻灯片图像的终端这个Library的ffmpeg -

以下命令是用来从渲染视频图像列表。

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

最后,我终于得到了Deepak正确的命令。

String command[] = {"-y", "-f", "concat", "-safe", "0", "-i", gpxfile.getAbsolutePath(), "-vsync", "vfr", "-pix_fmt", "yuv420p", root.getAbsolutePath()+"/"+"video.mp4"}; 
0

您的文本文件更改为

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' 

,然后编码此命令:

ffmpeg -f concat -i gpxfile.getAbsolutePath() -c:v libx264 -vf fps=25 -pix_fmt yuv420p root.getAbsolutePath()/video.mp4 
+0

它引发此错误[@的concat 0xacb2e1d0]不安全文件名 '/存储/模拟/ 0/SlideShowMaker/SlideShowMaker图片/ IMG-20171019-WA001-1尺度-1.JPG' /存储/模拟/0/SlideShowMaker/command.txt:不允许操作 –

+0

在'-i'之前加'-safe 0' – Mulvya