0
点赞
收藏
分享

微信扫一扫

C# ffmpeg 视频处理格式转换具体案例

C# ffmpeg 视频处理格式转换

C# ffmpeg 视频处理格式转换avi到MP4格式

1、代码如下:

 

using System;
using System.Diagnostics;

namespace LongtengSupremeConsole
{
    class Program
    {     
        static void Main(string[] args)
        {           
            string para = $"ffmpeg -i 123.avi 11233.mp4";
            RunProcess(para);          
            Console.WriteLine("完成!");
            Console.ReadKey();
        }

        static void RunProcess(string Parameters)
        {
            var p = new Process();
            p.StartInfo.FileName = "CMD";
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.Arguments = Parameters;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.CreateNoWindow = true;
            p.Start();
            p.StandardInput.WriteLine(Parameters);
            Console.WriteLine("\n开始转码...\n");
            //p.WaitForExit();
            // p.Close();
        }
    }
}

2、首先debug生成Debug,然后把下载的ffmpeg.exe(可以到​​https://ffmpeg.org/download.html​​下载,)拷贝到Debug下,直接运行程序就可以了

 

3、运行效果如下:

C# ffmpeg 视频处理格式转换具体案例_htmlC# ffmpeg 视频处理格式转换具体案例_格式转换_02

4、ffmpeg下载

第一种: ​​https://ffmpeg.org/download.html​​,可以看到源码和build版本

C# ffmpeg 视频处理格式转换具体案例_格式转换_03C# ffmpeg 视频处理格式转换具体案例_格式转换_04

第二种:​​https://ffmpeg.zeranoe.com/builds/​​,直接下载编译版本

C# ffmpeg 视频处理格式转换具体案例_html_05C# ffmpeg 视频处理格式转换具体案例_视频处理_06

 

龙腾一族至尊龙骑

举报

相关推荐

0 条评论