wonjsohn / google-glass-api

Automatically exported from code.google.com/p/google-glass-api
0 stars 0 forks source link

MediaPlayer has weird color rendering #549

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a MediaPlayer using standard Android APIs
2. Set up the sample app to play a certain video (ex. 
"http://s50.podbean.com/pb/0a328fc0c7cbb04fe3027c117790304f/53a3ba8e/data2/blogs
60/674644/uploads/uep666_18.mp4")
3. Run the app and watch the video on Google Glass

What is the expected output? What do you see instead?
I expect to see the video rendered normally.
Instead, there seems to be odd color issues. Blues become orange. Tans become 
blue. I'm not sure why since the same code runs on my tablet without any color 
issues.

What version of the product are you using? On what operating system?
XE 18.11

Please provide any additional information below.
This works fine on my tablet, because this is very ordinary code. I'll attach 
specific code below. It's a regular mp4, not special.

I will be building an app using MediaPlayer. Right now I'm doing some testing 
and already I'm running into odd issues.

Original issue reported on code.google.com by Han...@gmail.com on 21 Jun 2014 at 7:13

Attachments:

GoogleCodeExporter commented 8 years ago
Edit:
Unusually, when I try to take a picture using the camera, the colors correct 
themselves. Thus, it isn't easy to just take a picture of what's happening. 
Additionally, the screencast shows the colors correctly. The only way to 
understand the issue is to run the code.

Original comment by Han...@gmail.com on 21 Jun 2014 at 7:22

GoogleCodeExporter commented 8 years ago
I have exactly the same issue using videoview. Did you find a solution ?

Original comment by stephane...@gmail.com on 26 Jun 2014 at 9:11

GoogleCodeExporter commented 8 years ago
If need i found an "ugly" hack to get the right video color.

Just after your video start display a transparent 1px X 1px PNG :

        videoHolder.start();
        ImageView imgHack = (ImageView) this.findViewById(R.id.imageHack);
        imgHack.setVisibility(View.VISIBLE);

In the activity layout :

    <ImageView 
        android:id="@+id/imageHack" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:visibility="gone" 
        android:src="@drawable/ic_hack_50" 
        android:contentDescription="@string/imgHack" /> 

I hope Google will fix that, but this temporary solution work for me.

Original comment by stephane...@gmail.com on 26 Jun 2014 at 10:29

GoogleCodeExporter commented 8 years ago
There are swapped-color-channel artifacts in a lot of other places, too. I 
haven't figured out a clear pattern to it, but I've seen it happen in the 
intent-disambiguation card scroll view (but only while an animation is in 
progress!), in the alt-tab dialog (but sensitive to details of what's 
composited under it), and in VX ConnectBot. It's inconsistent in weird, 
seemingly timing-sensitive ways. Whatever the problem is, it's probably in 
compositing (surfaceflinger?), not in MediaPlayer.

Original comment by jimrandomh@gmail.com on 14 Jul 2014 at 9:27

GoogleCodeExporter commented 8 years ago
I also have the same colour issues with the VideoView.

The video I'm using is the one here: 
http://d5kh2btv85w9n.cloudfront.net/1/16/Replace%20a%20Bicycle%20Tire%20Step%201
.360p.mp4

But I pulled it down locally and I'm referencing from res/raw.

While playing, it appears very blue. It's most noticeable from the guy's blue 
hand! But it flicks back to the correct colour as soon as the video finishes 
playing. Funnily enough though, occasionally I also see it appear correctly 
while playing, if I restart the video.

Here's my code for creating the view:

VideoView videoView = new VideoView(this);
videoView.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" 
+ R.raw.remove_front_wheel));
videoView.start();

I'm using it inside a CardScrollView, with a CardScrollAdapter.

Original comment by peter.os...@gmail.com on 17 Jul 2014 at 3:29

GoogleCodeExporter commented 8 years ago
One other note: color-channel artifacts have been present at least as far back 
as XE11 (which was the oldest version I tried).

Original comment by jimrandomh@gmail.com on 17 Jul 2014 at 3:50

GoogleCodeExporter commented 8 years ago
The imageHack fix above didn't work for me, but I found something else that 
does the trick: setting the background colour!:

videoView.setBackgroundColor(0);

Original comment by peter.os...@gmail.com on 17 Jul 2014 at 4:12

GoogleCodeExporter commented 8 years ago
videoView.setBackgroundColor(0); worked for me, thank you! no more smurf vision!

Original comment by scottdri...@gmail.com on 29 Aug 2014 at 11:58

GoogleCodeExporter commented 8 years ago
Works for me too :)
Thank you.

Original comment by arainzil...@gmail.com on 9 Sep 2014 at 3:53

GoogleCodeExporter commented 8 years ago
I'm having a very similar issue, however I'm attempting to trigger video 
playback from the Unity game engine, using 
Handheld.PlayFullScreenMovie("path_to_movie.mp4", Color.black);

Does anyone know of a fix that will work around this issue using Unity? There's 
a parameter to set the background color, but it doesn't seem to matter what I 
set it to, I get the same strange color issues.

Thanks

Original comment by mark.cau...@gmail.com on 16 Nov 2014 at 12:46

GoogleCodeExporter commented 8 years ago
We had this same issue on something we were working on. Aside from screwing up 
the color of the video, the VideoView class is also known to break detecting 
left and right swipes. 

DITCH THE VIDEOVIEW CLASS!!!

I resolved the screwed up color AND the broken left and right swipe detection 
by ditching VideoView and instead creating a TextureView and creating a 
MediaPlayer inside of there. 

Original comment by Tetreau...@gmail.com on 23 Jan 2015 at 4:19