Akh
Akh

Reputation: 6043

How to maintain aspect-ratio when playing RTSP streaming video in Android?

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....

Upvotes: 1

Views: 2739

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007464

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.

Upvotes: 0

Related Questions