当前位置:网站首页>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
边栏推荐
- Read PDF image and identify content
- [unity][ecs] learning notes (I)
- 卸载oracle报错
- Summary of MySQL basic knowledge points
- 解析:去中心化托管解决方案概述
- The boss asked me to write an app automation -- yaml file reading -- with the whole framework source code attached
- 适配器模式(Adapter)
- Ideal interface automation project
- Why does istio use spirit for identity authentication?
- Fabric.js 笔刷到底怎么用?
猜你喜欢

纵观jBPM从jBPM3到jBPM5以及Activiti
![[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting](/img/a8/51b95432a9c8f25d8440cfd80926ce.png)
[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting

Au revoir! Navigateur ie, cette route Edge continue pour IE

Global exception handlers and unified return results

Dbeaver installation and use tutorial (super detailed installation and use tutorial)

Starting from full power to accelerate brand renewal, Chang'an electric and electrification products sound the "assembly number"

To enhance the function of jupyter notebook, here are four tips

代理模式(Proxy)

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

How to view the web password saved by Google browser
随机推荐
为什么 Istio 要使用 SPIRE 做身份认证?
Ribbon核心源码解析
[unity][ecs] learning notes (I)
Fabric.js 笔刷到底怎么用?
dotnet 使用 Crossgen2 对 DLL 进行 ReadyToRun 提升启动性能
Key summary V of PMP examination - execution process group
各位大佬,问下Mysql不支持EARLIEST_OFFSET模式吗?Unsupported star
第六天 脚本与动画系统
Why does istio use spirit for identity authentication?
Decorator
Generate token
Please consult me. I run the MYSQL to MySQL full synchronization of flykcdc in my local ide. This is in my local ide
JSON数据与List集合之间的正确转换
Methods for creating multithreads ---1 creating subclasses of thread class and multithreading principle
MySQL的开发环境和测试环境有什么区别??
What is the difference between MySQL development environment and test environment??
Solve the problem that the value of the action attribute of the form is null when transferring parameters
Resolution: overview of decentralized hosting solution
Looking at jBPM from jbm3 to jbm5 and activiti
纵观jBPM从jBPM3到jBPM5以及Activiti