简体   繁体   English

以 mjpeg 和 h.264 格式从网络摄像机流式传输音频和视频

[英]Stream audio and video from ip camera in both mjpeg and h.264

I want to create an android application that will stream video from an IP camera.我想创建一个 android 应用程序,它将从 IP 摄像机流式传输视频。 I tried to use a simple MJPEG viewer but it doesn't allow me to play the video with audio.我尝试使用一个简单的 MJPEG 查看器,但它不允许我播放带有音频的视频。 My IP camera provides samples encoded in h.264 and I need to record both video and audio stream from it.我的 IP 摄像机提供了以 h.264 编码的样本,我需要从中记录视频和音频流。

You can use ExoPlayer , Android's MediaPlayer API for playing audio and video both locally and over the Internet.您可以使用ExoPlayer ,Android 的 MediaPlayer API 在本地和互联网上播放音频和视频。

ExoPlayer supports features like Dynamic adaptive streaming over HTTP (DASH), SmoothStreaming and Common Encryption, which are not supported by regular Android's MediaPlayer. ExoPlayer 支持诸如基于 HTTP 的动态自适应流媒体 (DASH)、SmoothStreaming 和通用加密等功能,而常规 Android 的 MediaPlayer 不支持这些功能。

Checkout the documentation here .此处查看文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM