当前位置:网站首页>【技术教程】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
边栏推荐
- [elixir! 0073] beam built-in memory database ETS
- Use call, apply and bind to solve the annoying this in JS, this in event binding and parameter passing
- csdn bug10:待加
- CSDN bug9: to be added
- 商品管统——采购需求合并到采购单
- 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
- csdn bug4:待加
- OSChina 周二乱弹 —— 我养的绿植分别为土豆,生姜,蒜
- 对于程序员,那些既陌生又熟悉的计算机硬件
猜你喜欢
The solution of polar experience insensitive verification
Incomplete Polyfill of proxy
【LeetCode】 92 整数反转
Bartender2021实现安全远程标签打印,年终全新发布
[leetcode] 92 integer inversion
On fedlearner, the latest open source federated machine learning platform of byte
Fire knowledge online answer activity small program
gnu汇编-基本数学方程-乘法
An unsafe class named unsafe
csdn bug5:待加
随机推荐
Gets the property value of a column in the list collection object
Filezilla server配置FTP服务器中的各种问题与解决方法
Yixian e-commerce prospectus of perfect diary parent company: focusing on marketing and ignoring R & D, with a loss of 1.1 billion in the first three quarters
[论文阅读笔记] Large-Scale Heterogeneous Feature Embedding
将Map中对应的key和value赋值到对象中
CCR炒币机器人:新冠肺炎加速了监管机构对CBDC的兴趣
CSDN bug4: to be added
Experiment 2
pytorch训练GAN时的detach()
Coding style: SSM environment in MVC mode, code hierarchical management
编码风格:Mvc模式下SSM环境,代码分层管理
For programmers, those unfamiliar and familiar computer hardware
csdn bug7:待加
JS solves the problem of automatic pagination in browser printing
Graph undirected graph
Assign the corresponding key and value in the map to the object
lodash.js源码-flatten
delete、truncate、drop 有什么区别,误删数据怎么办
JMeter的简单使用
selenium webdriver使用click一直失效问题的几种解决方法