How to concatenate two MP4 files using FFmpeg?

后端 未结 22 3065
遇见更好的自我
遇见更好的自我 2020-11-22 02:32

I\'m trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I\'m converting the two files into .ts files and th

22条回答
  •  孤街浪徒
    2020-11-22 03:15

    The accepted answer in the form of reusable PowerShell script

    Param(
    [string]$WildcardFilePath,
    [string]$OutFilePath
    )
    try
    {
        $tempFile = [System.IO.Path]::GetTempFileName()
        Get-ChildItem -path $wildcardFilePath | foreach  { "file '$_'" } | Out-File -FilePath $tempFile -Encoding ascii
        ffmpeg.exe -safe 0 -f concat -i $tempFile -c copy $outFilePath
    }
    finally
    {
        Remove-Item $tempFile
    }
    

提交回复
热议问题