如何在Android的播放RTSP流媒体视频时保持纵横比? [英] How to maintain aspect-ratio when playing RTSP streaming video in Android?

查看:770
本文介绍了如何在Android的播放RTSP流媒体视频时保持纵横比?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我与VideoView的帮助下打RTSP流媒体视频链接。在纵向模式下的视频分辨率和宽高比是完美的。但是当我尝试切换到横向模式视频伸展和拉长的看起来。这种扭曲的质量很大。


  1. 如何使videoview保持在两个方向的模式相同的纵横比任何提示?

  2. 如果我需要编写扩展VideoView我自己的媒体播放器。我究竟应该如何重写onMeasure(...),以正确呈现视频?例如任何将在Android开发者网站
  3. 有限的文件有很大的帮助的堂妹
  4. 如何找到通过RTSP接收的视频的大小?这样我们就可以在videoview设置为大小?

如果我愿意听,因为我很新的媒体API的任何建议....


解决方案

  

如何让videoview保持在两个方向的模式相同的纵横比任何提示?


它一般不会。 该项目,例如,与当地的测试工作正常。 MP4文件(在外部存储的根)的肖像和风景,同时保持纵横比。

I have a streaming RTSP video link which I am playing with the help of VideoView. In the portrait mode the Video resolution and aspect ratio is perfect. But when I try switching to the landscape mode the video stretches and looks elongated. This distorts the quality to a great deal.

  1. Any tips of how to make the videoview to maintain the same aspect ratio in both orientation modes?
  2. If i need to write my own media player extending the VideoView .. How exactly should I override the onMeasure(...) to render the video properly? any example will be of great help coz of the limited documentation on android developer site
  3. How to find the size of the video received through RTSP? so that we can set the videoview to that size?

If any suggestions I am open to listen as I am quite new to the Media API....

解决方案

Any tips of how to make the videoview to maintain the same aspect ratio in both orientation modes?

It normally does. This project, for example, works properly with a local test.mp4 file (in the root of external storage) in portrait and landscape, while maintaining aspect ratio.

这篇关于如何在Android的播放RTSP流媒体视频时保持纵横比?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆