将 mp4 文件流式传输到 Android 设备时仅播放音频
我已经设置 Wowza 流媒体服务器将 mp4 视频流式传输到 Android 手机。 Android手机可以成功播放RTSP流,但这里它只播放文件的音频而不是视频。
I 've set Wowza streaming server to stream mp4 videos to Android phones. Android phone can play the RTSP stream successfully but here It only plays audio of the file not the video.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否设置了要在其上显示视频的表面(VideoView 或 SurfaceView)?您必须运行 setDisplay在运行播放之前。
过早开始播放也可能导致视频问题。
您应该在创建表面后启动播放器。如果您想在 Activity 启动时开始播放,您应该在 surfaceCreated 事件上执行此操作。 通过实现 SurfaceHolder.Callback 来监听此事件
您可以 你提供一些源代码吗?
您也可以尝试关注 Android ApiDemos。视频流播放器示例可以在以下位置找到:
Did you set surface (VideoView or SurfaceView) on which you would like to display video? You have to run setDisplay before running playback.
Problems with video can also be caused by starting playback too early.
You should start player after surface is created. If you want to start playback at start of the Activity, you should do it on surfaceCreated event. You can listen to this event by implementing SurfaceHolder.Callback
Can you provide some source codes?
You can also try to follow Android ApiDemos. Video streaming player example can be found at: