当前位置:网站首页>【技术教程】C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
【技术教程】C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
2020-11-10 08:54:00 【osc_b71hj3or】
之前写过一篇科普文《如何使用RTSP推流组件EasyPusher将MP4文件推到EasyDarwin开源平台》,在该文中 ,我们尝试了通过EasyPusher将MP4文件推到EasyDarwin,但是除了这个方法之外,我们还有其他方法将MP4文件推送到EasyDarwin上。
本文就和大家分享一下C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程。
1、新建一个控制台应用项目,将下载好的FFMPEG放在程序根目录下面,如下图:

在main函数中写如下代码:
static void Main(string[] args)
{
string exePath = "./ffmpeg/bin/ffmpeg.exe";
string arguments = "";
arguments = "-re -stream_loop -1 -i test.mp4 -vf ";
arguments += "settb=AVTB,setpts='trunc(PTS/1K)*1K+st(1,trunc(RTCTIME/1K))-1K*trunc(ld(1)/1K)',drawtext=fontsize=20:fontcolor=white:text='%{localtime}'";
arguments += " -rtsp_transport tcp -vcodec h264 -f rtsp rtsp://127.0.0.1:554/test2.sdp";
ProcessStartInfo info = new ProcessStartInfo(exePath, arguments);
info.WindowStyle = ProcessWindowStyle.Hidden;
info.UseShellExecute = false;
info.RedirectStandardInput = false;//可能接受来自调用程序的输入信息
info.RedirectStandardOutput = false;//由调用程序获取输出信息
info.RedirectStandardError = false;//重定向标准错误输出
info.CreateNoWindow = false;//不显示程序窗口
Process AppProcess = System.Diagnostics.Process.Start(info);
AppProcess.WaitForExit();
}
2、运行控制台程序,可以看到已经将程序目录下的test.mp4视频以RTSP形式推送至EasyDarwin,我们看下流媒体服务器EasyDarwin的运行情况:

可以用VLC查看实际播放效果,如下图:

如果有用户想了解我们的开源项目,可以进入EasyDarwin了解,并且经过多年的经验积累,我们已经研发出了基于EasyDarwin衍生的EasyNVR、EasyDSS等视频平台,大家均可了解。如有疑问,欢迎咨询。
版权声明
本文为[osc_b71hj3or]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4324660/blog/4710489
边栏推荐
- 港股上市公司移卡收购创信众42.5%股权 谋划加快营销服务布局
- 假如需要一百万个对象
- CUDA_ Get the specified device
- Wu Enda's refining notes on machine learning 4: basis of neural network - Zhihu
- Promote China manufacturing upgrade, 3D visualization of production line in automobile assembly workshop
- JS label syntax jumps out of multiple loops
- 从零开始学习 YoMo 系列教程:开篇
- CSDN bug11: to be added
- ServiceManagerProxy中mRemote变量指的什么?
- csdn bug5:待加
猜你喜欢

利用尾巴作为时间序列进行处理来识别鲸鱼

《Python Cookbook 3rd》笔记(2.2):字符串开头或结尾匹配

leetcode之最后一个单词的长度

关于centos启动报错:Failed to start Crash recovery kernel arming的解决方案

注册滴滴加不上车怎么办?要怎么处理?
![[leetcode] 92 integer inversion](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[leetcode] 92 integer inversion

对于程序员,那些既陌生又熟悉的计算机硬件

Android quick shutdown app
![[paper reading notes] large scale heterogeneous feature embedding](/img/00/df94bfe594e17ab120c30fd6b31931.jpg)
[paper reading notes] large scale heterogeneous feature embedding

Incomplete Polyfill of proxy
随机推荐
Coding style: SSM environment in MVC mode, code hierarchical management
竞争性编程的思考:那些神话和令人震惊的事实[图]
Explanation of Z-index attribute
Wu Enda's refining notes on machine learning 4: basis of neural network - Zhihu
csdn bug5:待加
CSDN bug8: to be added
图-无向图
CSDN bug7: to be added
初级工程师如何在职场生存
Self writing performance testing tool (2)
Seam engraving algorithm: a seemingly impossible image size adjustment method
Bifrost 位点管理 之 异构中间件实现难点(1)
On fedlearner, the latest open source federated machine learning platform of byte
推动中国制造升级,汽车装配车间生产流水线 3D 可视化
Filezilla server配置FTP服务器中的各种问题与解决方法
csdn bug10:待加
ASP.NET Core框架揭秘[博文汇总-持续更新]
极验无感验证破解
CUDA_ Get the specified device
Coding style: SSM environment in MVC mode, code hierarchical management