Browse Source

zhao:1直播推流方法2传参

ZhangXueYang
耀 3 years ago
parent
commit
157d3f8471
3 changed files with 8 additions and 2 deletions
  1. 2
    2
      Common/system/FFMpeg.cs
  2. 2
    0
      XHZB.Desktop/App.config
  3. 4
    0
      XHZB.Desktop/App.cs

+ 2
- 2
Common/system/FFMpeg.cs View File

61
                 Thread.Sleep(100);
61
                 Thread.Sleep(100);
62
             }
62
             }
63
             ErrMessage = null;
63
             ErrMessage = null;
64
-            string RTMPPathName = "rtmp://" + RTMPPath + "/" + NodeKey;//rtmp://live.xhkjedu.com/live/test
64
+            string RTMPPathName = "rtmp://" + RTMPPath + "/" + NodeKey;//rtmp://live2.xhkjedu.com/live/test
65
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
65
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
66
             foreach (Process KillProcess in KillProcessArray)
66
             foreach (Process KillProcess in KillProcessArray)
67
             {
67
             {
122
                 }
122
                 }
123
             }
123
             }
124
 
124
 
125
-            myProcess.StartInfo.Arguments = SpeakerStr + MicrophoneStr + " -f gdigrab -framerate 6 -offset_x 0 -offset_y 0 -video_size " + size.Width + "x" + size.Height + " -i desktop -pix_fmt yuv420p -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -acodec aac -f flv " + RTMPPathName;
125
+            myProcess.StartInfo.Arguments = SpeakerStr + MicrophoneStr + " -f gdigrab -framerate 6 -offset_x 0 -offset_y 0 -video_size " + size.Width + "x" + size.Height + " -i desktop -pix_fmt yuv420p -vf scale=trunc(iw/4)*2:trunc(ih/4)*2 -r 15 -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -acodec aac -f flv " + RTMPPathName;
126
 
126
 
127
             if (OutputVideoLog)
127
             if (OutputVideoLog)
128
             {
128
             {

+ 2
- 0
XHZB.Desktop/App.config View File

11
     <!--版本号-->
11
     <!--版本号-->
12
     <add key="VersionCode" value="1" />
12
     <add key="VersionCode" value="1" />
13
     <add key="VersionName" value="1.0.1" />
13
     <add key="VersionName" value="1.0.1" />
14
+    <!--流媒体服务器地址-->
15
+    <add key="ServerPath" value="live2.xhkjedu.com"/>
14
   </appSettings>
16
   </appSettings>
15
 </configuration>
17
 </configuration>

+ 4
- 0
XHZB.Desktop/App.cs View File

20
         /// </summary>
20
         /// </summary>
21
         public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
21
         public static bool isDebug = FileToolsCommon.GetConfigValue("IsDebug") != "0";
22
         /// <summary>
22
         /// <summary>
23
+        /// RTMP服务器地址
24
+        /// </summary>
25
+        public static string RTMPServerPath = FileToolsCommon.GetConfigValue("ServerPath");
26
+        /// <summary>
23
         /// 接口地址
27
         /// 接口地址
24
         /// </summary>
28
         /// </summary>
25
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("APIRequestAddress");
29
         public static string apiUrl = isDebug ? "http://schoolapitest.xhkjedu.com" : FileToolsCommon.GetConfigValue("APIRequestAddress");

Loading…
Cancel
Save