Exemple #1
0
        private string pushRtspStream(string ipServer, string ipSelf, int portSelf)
        {
            var para = GetFFMpegParaAndUrl(ipServer, ipSelf, portSelf);
            var mic  = GetMicName();
            var url  = "-f gdigrab -i desktop ";

            if (!string.IsNullOrWhiteSpace(mic))
            {
                url += " -f dshow -i audio=\"" + mic + "\" -acodec mp2 -ab 128k";
            }
            url += para[1];
            Loger.LogMessage("视频命令:" + url);
            this._ffmpeg = new Ffmpeg();
            this._ffmpeg.beginExecute(url);
            // var rtsp = "rtsp://" + ipServer + "/" + nameByIpPort + ".sdp";
            return(para[0]);
        }
Exemple #2
0
        private string pushVideoByFFmpeg(string ipServer, string ipSelf, int portSelf)
        {
            var para  = GetFFMpegParaAndUrl(ipServer, ipSelf, portSelf);
            var video = GetVideoName();

            if (string.IsNullOrWhiteSpace(video))
            {
                throw new Exception("未找到摄像头");
            }
            var url = "-f dshow -i video=\"" + video + "\"";
            var mic = GetMicName();

            if (!string.IsNullOrWhiteSpace(video))
            {
                url += ":audio =\"" + mic + "\" -acodec mp2 -ab 128k";
            }
            url += para[1];
            Loger.LogMessage("视频命令:" + url);
            this._ffmpeg = new Ffmpeg();
            this._ffmpeg.beginExecute(url);
            return(para[0]);
        }