Log in or register to post comments

Video Playback on a plane problems

July 5, 2012 - 11:28pm #1

Hi, I've been trying to debug this for a while now.  Can I get some answers on the new video playback features?  Is there a 'best' movie file format to use?  I've tried taking quicktimes and exporting as m4v and mp4.  I keep getting playback that is completely scrambled on the image plane, but only on some movies...others appear ok.  I can hear the audio, it's just the video that looks like bad analog tv reception. 

Another problem -After I scale the Video plane to match my image target, after building to the device, when tracking is found the video plane comes in about 25% larger than the image target page.  Also, the play icon is scaled up about 50% larger.  Can you think of something I should check?  it all lines up perfectly in the unity editor.

Video Playback on a plane problems

July 7, 2012 - 6:00pm #7

Thanks for posting that. Yes the sample makes some assumptions regarding the sizing and layout of the video window, for demonstration purposes, but these are exposed and can be customized.

Video Playback on a plane problems

July 7, 2012 - 9:58am #6

I found what was causing the problem. The VideoPlaybackBehavior.cs script was assuming a video image that had a greater width to height.  This code fixed my issues:

//Found under 'if (isPlayableOnTexture)' in the update loop...

                    if (videoWidth > 0 && videoHeight > 0)
                    {
                        float aspect;
                       
                        if(videoWidth > videoHeight)
                        {
                            aspect = videoHeight / (float) videoWidth;
                           
                               // Flip the plane as the video texture is mirrored on the horizontal
                            transform.localScale = new Vector3(-0.1f, 0.1f, 0.1f * aspect);                           
                        }
                        else
                        {
                            aspect = videoWidth / (float) videoHeight;
                           
                               // Flip the plane as the video texture is mirrored based on different aspect
                            transform.localScale = new Vector3(-0.1f * aspect, 0.1f, 0.1f );   
                        }

                    }

Video Playback on a plane problems

July 6, 2012 - 9:38pm #5

I found that if the video plane can't find the movie file, the keyframe image on the plane that appears on track found looks correct.  Things only go bad after the movie file is found.  I really need to get this issue solved.

Video Playback on a plane problems

July 6, 2012 - 2:15pm #4

Ok well I've tried other file formats and it seems that using Handbrake and exporting movies as mp4 with AAC audio seems to fix the scrambled video image.

As for the enlarged image target, I am still having this problem.  It's almost like the automatic scaling that happens on the play button icon is also being applied to the image plane. (when tracking is found, the VideoPlaybackBehavior script automatically scales up the play button icon)  I tried commenting out the code, but it just kept the button itself from scaling up.  Can you think of anything else I should try to get this to work right?

Video Playback on a plane problems

July 6, 2012 - 2:11pm #3

By the way -- Thank you Qualcomm-folk for the sample, it's much more performant than my own attempts at handling AR video playback.

Video Playback on a plane problems

July 6, 2012 - 6:39am #2

Hi patch24

Please not that the Video Playback is not a Vuforia feature, however the sample was provided because many people were asking for it.

However, the sample was tested with h.264 and AAC encoding in an MPEG 4 container.

As for the scaling issue this is something that we may be able to investigate.

 

N

 

Log in or register to post comments