Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video image corrupted when FFMpegMovieViewAndroid display screen set to landscape mode. (Portrait mode works perfectly!) #9

Closed
dreamflash opened this issue Nov 19, 2010 · 4 comments

Comments

@dreamflash
Copy link

Here is the steps to reproduce the bug.

  1. Target platform is Froyo.
  2. Set "Screen orientation" to "landscape" mode in the file AndroidManifest.xml
  3. Play any video file and observe the playback image is corrupted or heavily skewed.
    (video works perfectly in portrait mode)

First, I thought this might be the display matrix problem, so I have tried apply skewed and/or rotate 90 matrix to the doUpdateSurface() function inside libjnivideo.so library. but image still comes out incorrectly. It seems the problem really comes out from the java side. (Surface etc)
Havlenapetr, can you take a look into this issue. Thanks

@dcypang
Copy link

dcypang commented Jan 21, 2011

Did anyone has a solution to this issue ?

@dcypang
Copy link

dcypang commented Jan 21, 2011

I just hacked the issue by fixing the display size to 800x600 on a DROID device. i.e. on FFMpegMovieViewAndroid.java, in openVideo(), add mSurfaceHolder.setFixedSize(800, 600); before mPlayer.setDisplay(mSurfaceHolder);

@dreamflash
Copy link
Author

Confirmed. both fixes from havlenapetr and dcypand work, it solved the video corrupted in landscape mode. Thanks

//---------------------------------------------------------
From: havlenapetr

try this in FFMpegMovieViewAndroid class:

private void openVideo() {
try {
mSurfaceHolder.setFixedSize(800, 600);
mPlayer.setDisplay(mSurfaceHolder);
mPlayer.prepare();
} catch (IllegalStateException e) {
Log.e(TAG, "Couldn't prepare player: " + e.getMessage());
} catch (IOException e) {
Log.e(TAG, "Couldn't prepare player: " + e.getMessage());
}
}
//---------------------------------------------------------

@alexcohn
Copy link

The problem is the auto-scaling provided by the OS. Instead of hard-coding the screen size, simply set

<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>

in the AndroidManifest.xml file.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants