2017-10-13 93 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