gpt4 book ai didi

c# - ffmpeg c#asp视频转换

转载 作者:行者123 更新时间:2023-12-04 23:31:00 26 4
gpt4 key购买 nike

I am trying to convert one flv video to mp4 video. Why this following code results error? it gives exception as "No process is associated with this object." The parameters


"Path_FFMPEG"="E:\\Arun Kumar\\Main Project\\Advertisement Demo\\Advertisementdemo\\Advertisementdemo\\ffmpeg\\bin\\ffmpeg.exe" and "strParam"="-i E:\\Arun Kumar\\Main Project\\Advertisement Demo\\Advertisementdemo\\Advertisementdemo\\Videos\\cars1.flv -same_quant E:\\Arun Kumar\\Main Project\\Advertisement Demo\\Advertisementdemo\\Advertisementdemo\\Videos\\ConvertedFiles\\cars1.mp4"
Process ffmpeg = new Process();
ProcessStartInfo ffmpeg_StartInfo = new ProcessStartInfo(Path_FFMPEG, strParam);
ffmpeg_StartInfo.UseShellExecute = false;
ffmpeg_StartInfo.RedirectStandardError = true;
ffmpeg_StartInfo.RedirectStandardOutput = true;
ffmpeg.StartInfo = ffmpeg_StartInfo;
ffmpeg_StartInfo.CreateNoWindow = true;
ffmpeg.EnableRaisingEvents = true;
ffmpeg.Start();
ffmpeg.WaitForExit();
ffmpeg.Close();
ffmpeg.Dispose();
ffmpeg = null;

最佳答案

试试这个代码(假设你的 mp4 被命名为 video):

    System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = //PHYSICAL path to ffmpeg (use \\ instead of \);
proc.StartInfo.Arguments = "-i video.flv video.mp4
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.RedirectStandardOutput = false;
proc.Start();
proc.WaitForExit();
proc.Close();

关于c# - ffmpeg c#asp视频转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10443700/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com