在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
//项目引用 ffmpeg.exe 下载地址http://ffmpeg.org/ https://www.wowza.com/testplayers
var time = DateTime.Now; var minute = 2; //录制分钟 var fileName = Guid.NewGuid().ToString("N") + "_" + time.ToString("yyyyMMddHHmmss") + ".mp4"; string dir = Environment.CurrentDirectory; var proc = new Process(); proc.StartInfo.FileName = @"C:\Windows\system32\cmd.exe"; proc.StartInfo.WorkingDirectory = dir; proc.StartInfo.UseShellExecute = true; proc.StartInfo.RedirectStandardInput = false; proc.StartInfo.RedirectStandardOutput = false; proc.StartInfo.RedirectStandardError = false; proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal; proc.StartInfo.CreateNoWindow = false; proc.StartInfo.Arguments = $"/k ffmpeg -i {RtmpUrl} -c:a copy -c:v copy -t {minute * 60} {fileName}"; //-t 单位秒 proc.Start(); proc.WaitForExit(); //proc.Kill();
{RtmpUrl}
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论