我使用FFMPEG从图像生成视频,但总是需要相同的FPS。如何在生成视频时更改FPS?
cmd = new String[5];
cmd[0] = "-f";
cmd[1] = "image2";
cmd[2] = "-i";
cmd[3] = Environment.getExternalStorageDirectory()+"/Photo Story/image%d.jpg";
cmd[4] = PathVideo + "/"+ FileName;
答案 0 :(得分:1)
使用
cmd = new String [7]; cmd [0] =" -f&#34 ;; cmd [1] =" image2&#34 ;; cmd [2] =" -framerate&#34 ;; cmd [3] =" 25&#34 ;; cmd [4] =" -i&#34 ;; cmd [5] = Environment.getExternalStorageDirectory()+" / Photo Story / image%d.jpg&#34 ;; cmd [6] = PathVideo +" /" + FileName;
将25
替换为帧速率的变量或值。
答案 1 :(得分:0)
终于得到了溶解
cmd = new String [16]; cmd [0] =" -f&#34 ;; cmd [1] =" image2&#34 ;; cmd [2] =" -framerate&#34 ;; cmd [3] =" 3&#34 ;; cmd [4] =" -i&#34 ;; cmd [5] = Environment.getExternalStorageDirectory()+" /照片故事/图片%d.jpg&#34 ;;
cmd [6] =" -i&#34 ;; cmd [7] = AUDIOPATH; cmd [8] =" -c:a&#34 ;; cmd [9] =" copy&#34 ;; cmd [10] =" -vf&#34 ;;
cmd [11] =" fps = 1&#34 ;; cmd [12] =" -pix_fmt&#34 ;; cmd [13] =" yuv420p&#34 ;;
cmd [14] =" -shortest&#34 ;; cmd [15] = PathVideo +" /" + FileName;