Fetch the repository succeeded.
ffmpeg -y -f rawvideo -vcodec rawvideo -pix_fmt bgr24 -s 640x480 -r 10 -i - -c:v libx264 -pix_fmt yuv420p -preset ultrafast -f flv rtmp://120.26.82.157:1935/live/mystream
Process proc = new Process();
proc.StartInfo.FileName = @"ffmpeg.exe";
proc.StartInfo.Arguments = String.Format("-f image2pipe -i pipe:.bmp -maxrate {0}k -r {1} -an -y {2}",
bitrate, fps, outputfilename);
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardInput = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
for (int i = 0; i < 500; i++)
{
using (var ms = new MemoryStream())
{
using (var img = Image.FromFile(@"lena.png"))
{
img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
ms.WriteTo(proc.StandardInput.BaseStream);
}
}
}
https://stackoverflow.com/questions/19658415/how-to-use-pipe-in-ffmpeg-within-c-sharp https://mathewsachin.github.io/blog/2017/07/28/ffmpeg-pipe-csharp.html https://jiasule.v2ex.com/t/436280
软件架构说明
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。