1

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

Akh
  • 5,961
  • 14
  • 53
  • 82

1 Answers1

1

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.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • In my case it doesnt. I have video feed of size 240*180. It portrait it shows up as 240*180 and in the landscape as well shows up with the same resolution. I want the video to enlarge as much as it can without losing the aspect ratio. I am just using a RelativeLayout and positioned my VideoView in the ParentCenter. I kept it loose and didnt attach it to any of the boundaries of the parent. But still it shows up as the same resolution which is very very small for landscape. – Akh Mar 29 '11 at 00:35
  • @AKh: Try using the layouts in my sample project. – CommonsWare Mar 29 '11 at 00:39
  • Hi Mark, Your layout did the trick. Its scaling perfectly. Thank you Mark.I have another question I want a customized media controller with a just a pause button, exit button and a seek bar which at the start end (left corner) says the time elapsed and on the other end should say "Live" instead of the time remaining as it is a live feed. any thoughts on this please? – Akh Mar 29 '11 at 01:32
  • https://www.youtube.com/watch?v=Q-GLuydiMe4 ... when I use this link foe converting into the rtsp format ... doesn't play but other video id running well. have you any idea .. why is it happening ? – Akarsh M Feb 24 '14 at 11:58