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,7 +61,7 @@ namespace Common.system
61 61
                 Thread.Sleep(100);
62 62
             }
63 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 65
             Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
66 66
             foreach (Process KillProcess in KillProcessArray)
67 67
             {
@@ -122,7 +122,7 @@ namespace Common.system
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 127
             if (OutputVideoLog)
128 128
             {

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

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

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

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

Loading…
Cancel
Save