当前位置:网站首页>Ffmpeg audio and video recording
Ffmpeg audio and video recording
2022-06-28 10:14:00 【51CTO】
ffmpeg Video recording ffmpeg,ffplay,ffprobe It is mainly used for audio and video recording, playing and viewing multimedia files . This article will lead you to learn common commands . There are many common parameters , have access to ffprobe --help To view detailed help information
#region ffmpeg Video recording ffmpeg,ffplay,ffprobe It is mainly used for audio and video recording, playing and viewing multimedia files . This article will lead you to learn common commands . There are many common parameters , have access to ffprobe --help To view detailed help information
#region ffmpeg videotape
Process process = null;
private void btnFfmepgStart_Click(object sender, EventArgs e)
{
#region MyRegion
//System.Diagnostics.Process.Start(@"C:\Users\Administrator\Desktop\Debug\WindowsFormsTestVideo.exe"," Parameters 122");
//Process process1 = new Process();
//process1.StartInfo = new ProcessStartInfo(@"C:\Users\Administrator\Desktop\Debug\WindowsFormsTestVideo.exe");
//process1.StartInfo.Arguments = " Parameters 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=\" Microphone array (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="" Microphone array (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="" Microphone array (Realtek High Definition Audio)"" -pix_fmt yuv420p -tune zerolatency -af volume=5 -y 123.mp4";
// There's a lot of noise , Get rid of -af volume=5, The noise will be much better
//-ac passageway channel 1,2;
//-ar 8000 Sound sampling rate psp 24000Hz
//-ab Audio data stream , General choice 32,64,96,128 44100 Set this parameter to reduce the audio noise , But the tone will be a little dull
//-vol The volume Magnification
a = @"ffmpeg.exe -rtbufsize 200M -f dshow -i video=""USB Camera"" -f dshow -i audio="" Microphone array (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 = " Start recording ";
}
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 Play
// ffplay -autoexit ww.mp4
#endregion
#region ffprobe Check the information
// 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.
Be careful :ffmpeg Copy the relevant class libraries to the running directory , Download address

The supreme Dragon Rider of the dragon clan
边栏推荐
- 增量快照 必须要求mysql表有主键的吗?
- 再見!IE瀏覽器,這條路由Edge替IE繼續走下去
- R语言使用car包中的avPlots函数创建变量添加图(Added-variable plots)、在图像交互中,在变量添加图中手动标识(添加)对于每一个预测变量影响较大的强影响点
- Idea failed to connect to SQL Sever
- Why does istio use spirit for identity authentication?
- Restful style
- 第六天 脚本与动画系统
- Methods for creating multithreads ---1 creating subclasses of thread class and multithreading principle
- Flip CEP skip policy aftermatchskipstrategy Skippastlastevent() matched no longer matches the Bikeng Guide
- 第五章 树和二叉树
猜你喜欢

如何查看谷歌浏览器保存的网页密码

【NLP】今年高考英语AI得分134,复旦武大校友这项研究有点意思

Bron filter Course Research Report

适配器模式(Adapter)

sqlcmd 连接数据库报错

dotnet 使用 Crossgen2 对 DLL 进行 ReadyToRun 提升启动性能

使用 ABAP 操作 Excel 的几种方法
![QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])](/img/17/57ffb7393b71eddc5ac92ae3944338.jpg)
QT signal and slot communication mechanism (when multiple windows communicate back and forth [parent and child windows])

Dotnet uses crossgen2 to readytorun DLL to improve startup performance

解决表单action属性传参时值为null的问题
随机推荐
一文读懂 12种卷积方法(含1x1卷积、转置卷积和深度可分离卷积等)
Application of X6 in data stack index management
[unity][ecs] learning notes (II)
What is the difference between MySQL development environment and test environment??
读取pdf文字和excel写入操作
Naming rules and specifications for identifiers
Au revoir! Navigateur ie, cette route Edge continue pour IE
mysql打不开,闪退
The boss asked me to write an app automation -- yaml file reading -- with the whole framework source code attached
学习机器学习的最佳路径是什么
Unity loads AssetBundle resources from the server and writes them to local memory, and loads the downloaded and saved AB resources from local memory to the scene
Read PDF image and identify content
Chapter 3 stack and queue
老板叫我写个APP自动化--Yaml文件读取--内附整个框架源码
[happy Lantern Festival] guessing lantern riddles eating lantern festival full of vitality ~ (with lantern riddle guessing games)
Interface automation framework scaffolding - Implementation of parametric tools
Sword finger offer | Fibonacci sequence
Unity 从服务器加载AssetBundle资源写入本地内存,并将下载保存的AB资源从本地内存加载至场景
Generate token
[Unity][ECS]学习笔记(二)