当前位置:网站首页>C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
C#控制台调用FFMPEG推MP4视频文件至流媒体开源服务平台EasyDarwin过程
2020-11-09 17:46:00 【TSINGSEE】
之前写过一篇科普文《如何使用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等视频平台,大家均可了解。如有疑问,欢迎咨询。
版权声明
本文为[TSINGSEE]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/4619556/blog/4710247
边栏推荐
- On agile development concept and iterative development scheme
- Function calculation advanced IP query tool development
- Experts' interpretation of four hot industries in 2020 China telecom terminal technology and Standards Forum
- Gesture switch background, let live with goods more immersive
- 谈谈敏捷开发概念和迭代开发方案
- Six axes of calibration service
- 数据库执行truncate table CM_CHECK_ITEM_HIS怎么恢复
- Set two ways of background image, and solve the mobile phone background image highly adaptive problem
- 第三阶段 Day19 用户回显 封装Cookie 商品远程调用 购物车模块 CRUD操作
- 融云集成之避坑指南-Android推送篇
猜你喜欢

Toolkit Pro helps interface development: shorten the project development cycle and quickly realize GUI with modern functional area style

校准服务的六个轴心

Colleague notes - small program entry point

In the third stage, day19 users echo packaged cookie products and remotely call Shopping Cart module crud operation

Openocd-jtag debugging

自定义室内地图在线工具

解析:C++如何实现简单的学生管理系统(源码分享)

超简单集成华为系统完整性检测,搞定设备安全防护

拉线式位移传感器在边坡裂缝中的作用

Toolkit Pro助力界面开发:缩短项目开发周期,快速实现具有现代功能区样式的GUI
随机推荐
js对象数组去重
Chrome浏览器 js 关闭窗口失效解决方法
腾讯云AMD云服务器怎么样好不好?
5分钟GET我使用Github 5 年总结的这些骚操作!
CentOS view the number of CPU cores and cpuinfo analysis
GPS对时系统(网络对时仪器)应用电子政务系统
同事笔记-小程序入坑点
On agile development concept and iterative development scheme
In the third stage, day19 users echo packaged cookie products and remotely call Shopping Cart module crud operation
Introduction to zero base little white Python
[share] interface tests how to transfer files in post request
电商/直播速看!双11跑赢李佳琦就看这款单品了!
MIT6.824分布式系统课程 翻译&学习笔记(三)GFS
Do you think it's easy to learn programming? In fact, it's hard! Do you think it's hard to learn programming? In fact, it's very simple!
手势切换背景,让直播带货更加身临其境
JS object array de duplication
Six axes of calibration service
day83:luffy:添加购物车&导航栏购物车数字显示&购物车页面展示
第三阶段 Day19 用户回显 封装Cookie 商品远程调用 购物车模块 CRUD操作
解决微信小程序使用switchTab跳转后页面不刷新的问题