public bool GetLiveParam() { AggregatedConfig configManager = GlobalData.Instance.AggregatedConfig; try { if (configManager?.LocalLiveStreamInfo == null) { return(false); } LiveParam = new PublishLiveStreamParameter { LiveParameter = new LiveParameter() { AudioBitrate = 64, BitsPerSample = 16, Channels = 2, IsLive = true, IsRecord = false, SampleRate = 48000, VideoBitrate = configManager.LocalLiveStreamInfo.LiveStreamBitRate, Width = configManager.LocalLiveStreamInfo.LiveStreamDisplayWidth, Height = configManager.LocalLiveStreamInfo.LiveStreamDisplayHeight, Url1 = GlobalData.Instance.AggregatedConfig.LocalLiveStreamInfo.PushLiveStreamUrl, } }; } catch (Exception ex) { Log.Logger.Error($"【get server push live param exception】:{ex}"); return(false); } return(true); }
public PublishLiveStreamParameter GetLiveParam() { ConfigManager configManager = _localDataManager.GetSettingConfigData(); try { LiveParam = new PublishLiveStreamParameter { LiveParameter = new LiveParameter() { AudioBitrate = 64, BitsPerSample = 16, Channels = 1, IsLive = true, IsRecord = false, SampleRate = 8000, VideoBitrate = configManager.RemoteLiveStreamInfo.LiveStreamBitRate, Width = configManager.RemoteLiveStreamInfo.LiveStreamDisplayWidth, Height = configManager.RemoteLiveStreamInfo.LiveStreamDisplayHeight } }; } catch (Exception ex) { Log.Logger.Error($"【get server push live param exception】:{ex}"); return(null); } return(LiveParam); }
public bool GetRecordParam() { ConfigManager configManager = _localDataManager.GetSettingConfigData(); try { if (configManager?.RecordInfo == null) { return(false); } RecordParam = new PublishLiveStreamParameter() { LiveParameter = new LiveParameter() { AudioBitrate = 64, BitsPerSample = 16, Channels = 2, SampleRate = configManager.AudioInfo.SampleRate, VideoBitrate = configManager.RecordInfo.RecordBitRate, Width = configManager.RecordInfo.RecordDisplayWidth, Height = configManager.RecordInfo.RecordDisplayHeight, IsRecord = true, IsLive = false, FilePath = configManager.RecordInfo.RecordDirectory, }, MediaType = MediaType.StreamMedia, StreamType = StreamType.Live, }; RecordDirectory = configManager.RecordInfo.RecordDirectory; return(true); } catch (Exception ex) { Log.Logger.Error($"【get record param exception】:{ex}"); return(false); } }
internal static MEETINGMANAGE_PubLiveStreamParam ToStruct(this PublishLiveStreamParameter model) { MEETINGMANAGE_PubLiveStreamParam param = new MEETINGMANAGE_PubLiveStreamParam(); param.mediaType = (MEETINGMANAGE_MediaType)model.MediaType; param.sType = (MEETINGMANAGE_StreamType)model.StreamType; param.sParam.Url1 = model.LiveParameter.Url1; param.sParam.Url2 = model.LiveParameter.Url2; param.sParam.vBitrate = model.LiveParameter.VideoBitrate; param.sParam.width = model.LiveParameter.Width; param.sParam.aBitrate = model.LiveParameter.AudioBitrate; param.sParam.bitspersample = model.LiveParameter.BitsPerSample; param.sParam.channels = model.LiveParameter.Channels; param.sParam.filepath = model.LiveParameter.FilePath; param.sParam.height = model.LiveParameter.Height; param.sParam.isLive = model.LiveParameter.IsLive ? 1 : 0; param.sParam.isRecord = model.LiveParameter.IsRecord ? 1 : 0; param.sParam.samplerate = model.LiveParameter.SampleRate; return(param); }