当前位置:网站首页>C console calls ffmpeg to push MP4 video file to stream media open source service platform easydarwin process
C console calls ffmpeg to push MP4 video file to stream media open source service platform easydarwin process
2020-11-09 17:46:00 【TSINGS】
I wrote a popular science article before 《 How to use RTSP Push flow components EasyPusher take MP4 File pushed to EasyDarwin Open source platform 》, In this article , We tried to pass EasyPusher take MP4 File pushed to EasyDarwin, But in addition to this method , We have other ways to MP4 File push to EasyDarwin On .
This article will share with you C# The console calls FFMPEG PUSH MP4 Video files to streaming media open source service platform EasyDarwin The process .
1、 Create a new console application project , Will download okay FFMPEG Put it under the program root , Here's the picture :
stay main Write the following code in the function :
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;// May accept input from the caller
info.RedirectStandardOutput = false;// Get the output information from the calling program
info.RedirectStandardError = false;// Redirect standard error output
info.CreateNoWindow = false;// Don't show program window
Process AppProcess = System.Diagnostics.Process.Start(info);
AppProcess.WaitForExit();
}
2、 Run the console program , You can see the program directory in the test.mp4 Video with RTSP Push the form to EasyDarwin, Let's look at streaming servers EasyDarwin Operating condition :
It can be used VLC Check the actual playback effect , Here's the picture :
If there are users who want to know about our open source projects , Can enter the EasyDarwin understand , And after years of experience , We've developed a system based on EasyDarwin Derivative EasyNVR、EasyDSS Wait for the video platform , You can all understand . If you have any questions , Welcome to consult .
版权声明
本文为[TSINGS]所创,转载请带上原文链接,感谢
边栏推荐
猜你喜欢
Function calculation advanced IP query tool development
揭秘在召唤师峡谷中移动路径选择逻辑?
谷粒商城学习笔记,第五天:ES全文检索
Android软键盘遮挡的四种解决方案
From next year, about 30% of the web pages will be inaccessible to older Android devices
(3) ASP.NET Core3.1 Ocelot certification
Configure static IP address in ubuntu18.04 NAT mode -2020.11.09
R8 编译器: 为 Kotlin 库和应用 '瘦身'
【云小课】版本管理发展史之Git+——代码托管
上云嘉年华,超低价云服务器来袭
随机推荐
iOS下带小数点的数字键盘
Equivalent judgment between floating point numbers
【云小课】版本管理发展史之Git+——代码托管
EasyExcel根据筛选列导出(中间不空列,顺序可调整)
校准服务的六个轴心
详解Git
Source code analysis of serilog -- implementation of sink
如何设计并实现存储QoS?
菜鸟福音,28本书籍循序渐进让你成为大牛!(附学习大纲一份)
flask图书CURD小项目
Flash Book curd project
谷粒商城学习笔记,第五天:ES全文检索
ABBYY FineReader 15新增编辑页面布局功能
电商/直播速看!双11跑赢李佳琦就看这款单品了!
In the third stage, day16 user module jumps to SSO single sign on jsonp / CORS cross domain user login verification
揭秘在召唤师峡谷中移动路径选择逻辑?
【云小课】版本管理发展史之Git+——代码托管
单链表反转
Abbyy finereader 15 added edit table cell function
Avoid pitfall guide for cloud integration - Android push