当前位置:网站首页>ffmpeg录音录像
ffmpeg录音录像
2022-06-28 09:35:00 【51CTO】
ffmpeg录音录像 ffmpeg,ffplay,ffprobe主要用来录音录像播放查看多媒体文件的信息。本文带领大家学习常用命令。常用参数比较多,可以使用ffprobe --help来查看详细的帮助信息
#region ffmpeg录音录像 ffmpeg,ffplay,ffprobe主要用来录音录像播放查看多媒体文件的信息。本文带领大家学习常用命令。常用参数比较多,可以使用ffprobe --help来查看详细的帮助信息
#region ffmpeg 录像
Process process = null;
private void btnFfmepgStart_Click(object sender, EventArgs e)
{
#region MyRegion
//System.Diagnostics.Process.Start(@"C:\Users\Administrator\Desktop\Debug\WindowsFormsTestVideo.exe","参数122");
//Process process1 = new Process();
//process1.StartInfo = new ProcessStartInfo(@"C:\Users\Administrator\Desktop\Debug\WindowsFormsTestVideo.exe");
//process1.StartInfo.Arguments = "参数12277777777777777";
//process1.Start();
////process1.WaitForExit(10000);
////process1.Close();
//process1.Dispose();
#endregion
//ProcessStartInfo StartInfo = new ProcessStartInfo(@"C:\Windows\System32\cmd.exe");
process = new Process();
process.StartInfo = new ProcessStartInfo(@"C:\Windows\System32\cmd.exe");
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
//process.StartInfo.WorkingDirectory = @"C:\Windows\System32";// AppDomain.CurrentDomain.BaseDirectory;
process.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
string a = "ffmpeg -rtbufsize 200M -f dshow -i video=\"USB Camera\" -f dshow -i audio=\"麦克风阵列 (Realtek High Definition Audio)\" -pix_fmt yuv420p -b:v 300k -r 10 -vcodec libx264 -tune zerolatency -acodec aac -b:a 32k -ar 16000 -af volume=10 -y \"123.mp4\"";
string at = @"ffmpeg -rtbufsize 200M -f dshow -i video=""USB Camera"" -f dshow -i audio=""麦克风阵列 (Realtek High Definition Audio)"" -pix_fmt yuv420p -b:v 300k -r 10 -vcodec libx264 -tune zerolatency -acodec aac -b:a 32k -ar 16000 -af volume=10 -y ""123.mp4""";
//Log(a, MessageType.info);
//Log(at, MessageType.info);
//process.StandardInput.WriteLine(a);
process.OutputDataReceived += Process_OutputDataReceived;
process.ErrorDataReceived += Process_ErrorDataReceived;
//process.StartInfo.Arguments = a;
process.Start();
process.BeginErrorReadLine();
process.BeginOutputReadLine();
a = @"ffmpeg.exe -rtbufsize 200M -f dshow -i video=""USB Camera"" -f dshow -i audio=""麦克风阵列 (Realtek High Definition Audio)"" -pix_fmt yuv420p -tune zerolatency -af volume=5 -y 123.mp4";
//噪音很大,去掉 -af volume=5,噪音会好很多
//-ac 通道 声道 1,2;
//-ar 8000 声音的采样率 psp 24000Hz
//-ab 音频数据流,一般选择32,64,96,128 44100置成这个参数音频底噪会小,但是音色会有些发闷
//-vol音量 放大倍数
a = @"ffmpeg.exe -rtbufsize 200M -f dshow -i video=""USB Camera"" -f dshow -i audio=""麦克风阵列 (Realtek High Definition Audio)"" -pix_fmt yuv420p -tune zerolatency -ac 1 -ar 8000 -ab 44100 -vol 800 -y 123.mp4";
process.StandardInput.WriteLine(a);
//process.StandardInput.WriteLine(at/* + Environment.NewLine*/);
//process.StandardInput.WriteLine("\r\n");
Log(a, MessageType.info);
Log(at, MessageType.info);
lblffmepg.ForeColor = Color.Green;
lblffmepg.Text = "开始录音录像";
}
private void Process_ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
Log(e.Data, MessageType.error);
}
private void Process_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
Log(e.Data, MessageType.info);
}
private void btnFfmpegStop_Click(object sender, EventArgs e)
{
string a = "q";
process.StandardInput.WriteLine(a);
process.StandardInput.WriteLine("exit");
process.WaitForExit();
process.Close();
process.Dispose();
Process.Start("123.mp4");
lblffmepg.ForeColor = DefaultForeColor;
lblffmepg.Text = null;
}
#endregion
#region ffplay 播放
// ffplay -autoexit ww.mp4
#endregion
#region ffprobe 查看信息
// ffprobe -show_packets ww.mp4
#endregion
#endregion
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
- 89.
- 90.
- 91.
注意:ffmpeg相关的类库拷贝到运行目录,下载地址

龙腾一族至尊龙骑
边栏推荐
- Bron filter Course Research Report
- Ingersoll Rand panel maintenance IR Ingersoll Rand microcomputer controller maintenance xe-145m
- 大纲笔记软件 Workflowy 综合评测:优点、缺点和评价
- 手机号、邮箱正则验证[通俗易懂]
- Matplotlib属性及注解
- Static page of pinyougou mall
- A classic JVM class loaded interview question class singleton{static singleton instance = new singleton(); private singleton() {}
- HDI的盲孔设计,你注意到这个细节了吗?
- Calcul des frais d'achat et de vente d'actions
- Threads and processes
猜你喜欢

HDI blind hole design, have you noticed this detail?

全链路业务追踪落地实践方案

買賣股票費用計算

布隆过滤器 课程研究报告

缓存之王Caffeine Cache,性能比Guava更强

Machine virtuelle 14 installer win7 (tutoriel)

Key summary V of PMP examination - execution process group

1. Kimball dimension modeling of data warehouse: what is a fact table?

Calcul des frais d'achat et de vente d'actions

new URL(“www.jjj.com“)
随机推荐
函数的分文件编写
The private attribute of this class can be used directly? New() in use!!!
[share OpenGL tutorial]
QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])
01 distributed system overview
The digital human industry is about to break out. What is the market pattern?
详解final、finally和finalize
两道面试小Demo
Automatic conversion - interview questions
Wechat applet development log
什么是在线开户?现在网上开户安全么?
4 methods for exception handling
Basic knowledge of hard disk (head, track, sector, cylinder)
多线程-并发并行-线程进程
线程的生命周期
线程和进程
PMP考试重点总结五——执行过程组
1180: fractional line delimitation /p1068 [noip2009 popularization group] fractional line delimitation
Fastjason filter field
Custom exception classes and exercises