当前位置:网站首页>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相关的类库拷贝到运行目录,下载地址

龙腾一族至尊龙骑
边栏推荐
- Summary of PMP learning experience
- 静态代码块永远先执行? 格局小了!!!
- Unity AssetBundle资源打包与资源加载
- 4 methods for exception handling
- English translation plug-in installation of idea
- Xiaomi's payment company was fined 120000 yuan, involving the illegal opening of payment accounts, etc.: Lei Jun is the legal representative, and the products include MIUI wallet app
- Calculation of stock purchase and sale expenses
- Restful style
- Dbeaver连接人大金仓KingbaseES V8(超详细图文教程)
- Linux下安装redis 、Windows下安装redis(超详细图文教程)
猜你喜欢

Unity AssetBundle资源打包与资源加载

小米旗下支付公司被罚 12 万,涉违规开立支付账户等:雷军为法定代表人,产品包括 MIUI 钱包 App

Static page of pinyougou mall

Proxy mode (proxy)

纵观jBPM从jBPM3到jBPM5以及Activiti

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

TCP实战案例之即时通信、BS架构模拟

虚拟机14安装win7(图教程)

PMP考试重点总结五——执行过程组

Automatic conversion - interview questions
随机推荐
PMP考试重点总结四——规划过程组(2)
abnormal
01 distributed system overview
When the interviewer asks you to write binarysort in two ways
虚拟机14安装win7(图教程)
Play SFTP upload file
Methods for creating multithreads ---1 creating subclasses of thread class and multithreading principle
在本类私有属性直接使用?new()在使用!!!
如何查看谷歌浏览器保存的网页密码
详解final、finally和finalize
多线程-并发并行-线程进程
DolphinScheduler使用系统时间
Interpretation of new products: realm launched GT neo2 Dragon Ball customized version
Abnormal occurrence and solution
買賣股票費用計算
Flip CEP skip policy aftermatchskipstrategy Skippastlastevent() matched no longer matches the Bikeng Guide
[ybtoj advanced training guidance] class roll call [string hash]
手机号、邮箱正则验证[通俗易懂]
创建多线程的方法---1创建Thread类的子类及多线程原理
flink cep 跳过策略 AfterMatchSkipStrategy.skipPastLastEvent() 匹配过的不再匹配 碧坑指南