如何使用FFMPEG合并两个视频?

时间:2018-09-25 11:34:51

标签: android ffmpeg

String Tmp1 = Environment.getExternalStorageDirectory() + "/" + "scary.mp4";
inputCode = new String[]{FileUtils.getFFmpeg(getApplicationContext()),
                "-i", Tmp1, "-i", VideoPath, "-filter_complex",
                "[0:v][1:v]blend=all_mode='overlay':all_opacity=0.8[v_out]", "-map", "[v_out]", "-map", "0:a", "-strict", "-2", VideoPath};

inputCode是执行字符串。

2 个答案:

答案 0 :(得分:0)

ffmpeg命令应为

DECLARE @col VARCHAR(2000), @sql VARCHAR(4000)

SELECT @col = COALESCE(@col + ', ','') + QUOTENAME(meta_key)
FROM #wp_postmeta --Store all the columns with comma separated

SET @sql = '
SELECT post_id, ' + @col + '
FROM (
    SELECT 
        post_id, meta_key, meta_value
    FROM #wp_postmeta
) as s
PIVOT
(
    Max(meta_value)
    FOR [meta_key] IN (' + @col + ')
) AS pvt '

--PRINT(@SQL)
EXEC(@sql)

输入和输出文件不相同

答案 1 :(得分:0)

使用此命令将文件完全损坏

inputCode = new String[]{FileUtils.getFFmpeg(getApplicationContext()),"-y","-i",InputPath1, "-i",InputPath2,"-strict","experimental", "-filter_complex", "[0:v]scale=480x640,setsar=1:1[v0];[1:v]scale=480x640,setsar=1:1[v1];[v0][0:a][v1][1:a] concat=n=2:v=1:a=1", "-ab","48000","-ac","2","-ar","22050","-s","480x640","-r","30","-vcodec","mpeg4","-b","2097k",OutPutPath};

谢谢..