当前位置: 首页 > news >正文

园林设计网站大全wordpress 价格表插件

园林设计网站大全,wordpress 价格表插件,梅州市城乡建设部网站首页,wordpress 悬浮通知技术背景 我们在对接Unity平台camera场景采集的时候#xff0c;除了常规的RTMP推送、录像外#xff0c;还有一些开发者#xff0c;需要能实现轻量级RTSP服务#xff0c;对外提供个拉流的RTSP URL。 目前我们在Windows平台Unity下数据源可采集到以下部分#xff1a; 采集…技术背景 我们在对接Unity平台camera场景采集的时候除了常规的RTMP推送、录像外还有一些开发者需要能实现轻量级RTSP服务对外提供个拉流的RTSP URL。 目前我们在Windows平台Unity下数据源可采集到以下部分 采集Unity camera场景采集摄像头采集屏幕采集Unity声音采集麦克风采集扬声器Unity PCM混音 对外提供的技术能力有 RTMP直播推送轻量级RTSP服务实时录像、暂停|恢复录像实时预览。 以下录制下来的MP4文件是采集Unity camera场景音频是unity声音。 Unity平台实现camera场景实时录像 技术实现 实际上在实现Unity平台音视频能力之前我们原生模块已经有非常成熟的技术积累Unity下还是调用的原生的推送模块不同的是数据源需要采集Unity的audio、video然后高效的投递到底层模块底层模块负责编码打包并投递到RTMP或RTSP服务。 先说支持的音视频类型 public void SelVideoPushType(int type){switch (type){case 0:video_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_VIDEO_OPTION.NT_PB_E_VIDEO_OPTION_LAYER; //采集Unity窗体break;case 1:video_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_VIDEO_OPTION.NT_PB_E_VIDEO_OPTION_CAMERA; //采集摄像头break;case 2:video_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_VIDEO_OPTION.NT_PB_E_VIDEO_OPTION_SCREEN; //采集屏幕break;case 3:video_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_VIDEO_OPTION.NT_PB_E_VIDEO_OPTION_NO_VIDEO; //不采集视频break;}Debug.Log(SelVideoPushType type: type video_push_type: video_push_type_);}public void SelAudioPushType(int type){switch (type){case 0:audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_EXTERNAL_PCM_DATA; //采集Unity声音break;case 1:audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_CAPTURE_MIC; //采集麦克风break;case 2:audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_CAPTURE_SPEAKER; //采集扬声器break;case 3:audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_TWO_EXTERNAL_PCM_MIXER; //两路Unity AudioClip混音测试break;case 4:audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_NO_AUDIO; //不采集音频break;}Debug.Log(SelAudioPushType type: type audio_push_type: audio_push_type_);} 采集音视频数据 private void StartCaptureAvData(){if (audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_EXTERNAL_PCM_DATA|| audio_push_type_ (uint)NTSmartPublisherDefine.NT_PB_E_AUDIO_OPTION.NT_PB_E_AUDIO_OPTION_TWO_EXTERNAL_PCM_MIXER){PostUnityAudioClipData();}textures_poll_ new TexturesPool();post_image_worker_ new PostImageWorker(textures_poll_, publisher_wrapper_);post_worker_thread_ new Thread(post_image_worker_.run);post_worker_thread_.Start();}private void StopCaptureAvData(){if (post_image_worker_ ! null){post_image_worker_.requestStop();post_image_worker_ null;}if (post_worker_thread_ ! null){post_worker_thread_.Join();post_worker_thread_ null;}if (textures_poll_ ! null){textures_poll_.clear();textures_poll_ null;}StopAudioSource();} RTMP推送 public void btn_start_rtmp_pusher_Click(){if (publisher_wrapper_.IsPushingRtmp()){StopPushRTMP();btn_rtmp_pusher_.GetComponentInChildrenText().text 推送RTMP;return;}String url rtmp_pusher_url_.text;if (url.Length 8){publisher_wrapper_.Close();Debug.LogError(请输入RTMP推送地址);return;}if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsRecording()){publisher_wrapper_.SetVideoPushType(video_push_type_);publisher_wrapper_.SetAudioPushType(audio_push_type_);}if (!publisher_wrapper_.StartRtmpPusher(url)){Debug.LogError(调用StartPublisher失败..);return;}btn_rtmp_pusher_.GetComponentInChildrenText().text 停止推送;if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsRecording()){StartCaptureAvData();coroutine_ StartCoroutine(OnPostVideo());}} 轻量级RTSP服务相关调用 public void btn_rtsp_service_Click(){if (publisher_wrapper_.IsRtspServiceRunning()){publisher_wrapper_.StopRtspService();btn_rtsp_service_.GetComponentInChildrenText().text 启动RTSP服务;btn_rtsp_publisher_.interactable false;return;}if (!publisher_wrapper_.StartRtspService()){Debug.LogError(调用StartRtspService失败..);return;}btn_rtsp_publisher_.interactable true;btn_rtsp_service_.GetComponentInChildrenText().text 停止RTSP服务;}public void btn_rtsp_publisher_Click(){if (publisher_wrapper_.IsRtspPublisherRunning()){publisher_wrapper_.StopRtspStream();if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRecording()){StopCaptureAvData();if (coroutine_ ! null){StopCoroutine(coroutine_);coroutine_ null;}}btn_rtsp_service_.interactable true;btn_rtsp_publisher_.GetComponentInChildrenText().text 发布RTSP;}else{if (!publisher_wrapper_.IsRtspServiceRunning()){Debug.LogError(RTSP service is not running..);return;}if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRecording()){publisher_wrapper_.SetVideoPushType(video_push_type_);publisher_wrapper_.SetAudioPushType(audio_push_type_);}publisher_wrapper_.StartRtspStream();if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRecording()){StartCaptureAvData();coroutine_ StartCoroutine(OnPostVideo());}btn_rtsp_publisher_.GetComponentInChildrenText().text 停止RTSP;btn_rtsp_service_.interactable false;}}public void btn_get_rtsp_session_numbers_Click(){if (publisher_wrapper_.IsRtspServiceRunning()){btn_get_rtsp_session_numbers_.GetComponentInChildrenText().text RTSP会话数: publisher_wrapper_.GetRtspSessionNumbers();}} 实时录像调用 public void btn_record_Click(){if (publisher_wrapper_.IsRecording()){StopRecord();btn_record_.GetComponentInChildrenText().text 开始录像;return;}if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsPushingRtmp()){publisher_wrapper_.SetVideoPushType(video_push_type_);publisher_wrapper_.SetAudioPushType(audio_push_type_);}if (!publisher_wrapper_.StartRecorder()){Debug.LogError(调用StartRecorder失败..);return;}btn_record_.GetComponentInChildrenText().text 停止录像;if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsPushingRtmp()){StartCaptureAvData();coroutine_ StartCoroutine(OnPostVideo());}}public void StopRecord(){if (!publisher_wrapper_.IsPreviewing() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsPushingRtmp()){StopCaptureAvData();if (coroutine_ ! null){StopCoroutine(coroutine_);coroutine_ null;}}publisher_wrapper_.StopRecorder();}private void btn_pause_record_Click(){if (!publisher_wrapper_.IsPublisherHandleAvailable()){return;}String btn_pause_rec_text btn_pause_record_.GetComponentInChildrenText().text;if (暂停录像 btn_pause_rec_text){UInt32 ret publisher_wrapper_.PauseRecorder(true);if ((UInt32)NT.NTSmartPublisherDefine.NT_PB_E_ERROR_CODE.NT_ERC_PB_NEED_RETRY ret){Debug.LogError(暂停录像失败, 请重新尝试!);return;}else if (NTBaseCodeDefine.NT_ERC_OK ret){btn_pause_record_.GetComponentInChildrenText().text 恢复录像;}}else{UInt32 ret publisher_wrapper_.PauseRecorder(false);if ((UInt32)NT.NTSmartPublisherDefine.NT_PB_E_ERROR_CODE.NT_ERC_PB_NEED_RETRY ret){Debug.LogError(恢复录像失败, 请重新尝试!);return;}else if (NTBaseCodeDefine.NT_ERC_OK ret){btn_pause_record_.GetComponentInChildrenText().text 暂停录像;}}} 实时预览相关 public void btn_preview_Click(){if (btn_preview_.GetComponentInChildrenText().text.Equals(本地预览)){if (!publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsRecording()){publisher_wrapper_.SetVideoPushType(video_push_type_);}if (publisher_wrapper_.StartPreview()){btn_preview_.GetComponentInChildrenText().text 停止预览;}if (!publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsRecording()){StartCaptureAvData();coroutine_ StartCoroutine(OnPostVideo());}}else{if (!publisher_wrapper_.IsPushingRtmp() !publisher_wrapper_.IsRtspPublisherRunning() !publisher_wrapper_.IsRecording()){StopCaptureAvData();if (coroutine_ ! null){StopCoroutine(coroutine_);coroutine_ null;}}publisher_wrapper_.StopPreview();btn_preview_.GetComponentInChildrenText().text 本地预览;}} 总结 Unity平台下RTMP推送、录像、轻量级RTSP服务在虚拟仿真、医疗、教育等场景下应用非常广泛。要实现低延迟除了需要高效率的音视频数据采集编码和数据投递外还需要好的直播播放器支持。配合我们的SmartPlayer可轻松实现毫秒级体验满足绝大多数应用场景技术诉求。
http://www.zqtcl.cn/news/465673/

相关文章:

  • 怎样免费建设网站网站建设规划书txt微盘
  • 邯郸网站设计培训做网站建设公司crm在线的培训服务
  • 网站建设文化案例萧山网页设计
  • 融安有那几个网站做的比较好的林州网站建设熊掌号
  • 织梦个人博客网站源码深圳华强北鬼市
  • 成都公司建站模板营销策略有哪些方面
  • 南京哪里做网站河北建设工程交易信息网
  • 广州开发网站设计拍摄宣传片
  • 小型企业网站设计教程深圳seo网站推广方案
  • 做视频网站怎么备案最新网站架构
  • 黄金网站app软件下载安装免费淘宝网页版登录
  • 幸运28网站建设网站返回指定位置怎么做
  • 建设个直播网站要多少钱兴业大街网站建设
  • 网站设计培训班创业上海今天新闻发布会直播
  • 电商网站制作设计wordpress jquery 无法
  • 关键词优化易下拉效率北京和隆优化科技
  • 漯河企业网站开发天津建设协会网站
  • wap网站模式房产信息查询网
  • 做外贸怎么进入国外的网站百度指数总结
  • ui设计作品网站东莞做网站的网络公司
  • 网站未备案怎么访问做网站图片教程
  • 温州专业营销网站建设网络建设解决方案
  • 滨州网站建设 远洋科技网站需求建设书
  • 知道网站域名怎么联系域名解析不成功是什么意思
  • 武宁网站ui专业设计wordpress评论通知代码6
  • thymeleaf做网站 seo重庆平台网站建设找哪家
  • WordPress子站站群建筑工程网上申请质量安全监督
  • 怎么给网站添加图标山西手机版建站系统哪家好
  • frontpage网页制作视频教程昆明网站建设优化企业
  • 工信部 诚信网站备案公司网络营销方案