Topic locked

Video texture playback iOS 9.2

December 10, 2015 - 2:27am #1

Hi devs,

yesterday we finished our Unity+vuforia App and were ready for release. Then in the evening we saw that iOS 9.2 was released.

I upgraded my iPhone 6 this morning and everything looked fine, until I got to one of two video textures we've got in our App! I can hear the sound but the video is not shown. The screen is black. Another video texture with custom plane/mesh is working. Both are encoded the same way with Handbrake.

I'm just starting to see and compare versions, also upgrading an iPad mini to test on this. Just wanted to get this conversation going, because it's crucial for us.

Thanks

Video texture playback iOS 9.2

December 27, 2015 - 1:17am #12

Indeed, you need to select a Device (and not the iOS Simulator) to build the libVuforiaMedia project.

 

Video texture playback iOS 9.2

December 24, 2015 - 3:18am #11

Ok I found the problem: when I built the xcode project VuforiaMedia.xcodeproj I was selecting to build for the iOS Simulator and not IOS Generic Device; after building I had 3 libVuforiaMedia.a created by xCode, and I used the one inside the Debug-iphoneos folder. Now it works great!

Video texture playback iOS 9.2

December 23, 2015 - 10:34am #10

I have the same exact issue in my app, created in Unity.

I tried the method given by AlessandroB but xCode returns me 21 errors when I try to build my app...

I think is related to this:

"ld: warning: ignoring file /Users/andrea_mac/Desktop/errore2/Libraries/Plugins/iOS/libVuforiaMedia.a, file was built for archive which is not the architecture being linked (arm64): /Users/andrea_mac/Desktop/errore2/Libraries/Plugins/iOS/libVuforiaMedia.a"

what I've done wrong??

Video texture playback iOS 9.2

December 21, 2015 - 12:14am #9

I try  this way,but it's usefull....

My project  Instantiate  Video.prefab at first.

and get Android File Path(Mp4 path) to Video(Clone)'s path.

then,Deinit().

 

My mp4 has sound, is it a problem? 

Video texture playback iOS 9.2

December 19, 2015 - 1:21am #8

Hi railon,

Here is how you can fix the iOS 9.2 issue on the VideoPlayback sample apps, native and Unity (without having to split the audio from the video, as you did):

 

Native Videoplayback sample fix:

Edit the file VideoPlayerHelper.m; the color-highlitghted lines below are the ones to be added to the original code:

 

    switch (status) { 

            case AVPlayerItemStatusUnknown:

                DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusUnknown");

                if (mediaState != PLAYING) { // ADD THIS LINE

                    mediaState = NOT_READY;

                }// ADD THIS LINE

                break;

            case AVPlayerItemStatusReadyToPlay:

                DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay");

                if (mediaState != PLAYING) { // ADD THIS LINE

                    mediaState = READY;

                } // ADD THIS LINE

 

Unity Videoplayback sample:

(same code change but slightly more involved process)

In this case you need to edit the source code of the VuforiaMedia plugin which is located under /Assets/Plugins/iOS/VuforiaMedia in the VP Unity sample project

·        Rename the VideoPlayerHelper.m.txt to VideoPlayerHelper.m

·        Rename the VideoPlayerWrapper.mm.txt to VideoPlayerWraper.mm

·        Open the Xcode project in the VuforiaMedia folder

·        Edit the file VideoPlayerHelper.m; the color-highlitghted lines below are the ones to be added to the original code:

 

    switch (status) { 

            case AVPlayerItemStatusUnknown:

                DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusUnknown");

                if (mediaState != PLAYING) { // ADD THIS LINE

                    mediaState = NOT_READY;

                } // ADD THIS LINE

                break;

            case AVPlayerItemStatusReadyToPlay:

                DEBUGLOG(@"AVPlayerItemStatusObservationContext -> AVPlayerItemStatusReadyToPlay");

                if (mediaState != PLAYING) { // ADD THIS LINE

                    mediaState = READY;

                } // ADD THIS LINE

 

·        Build the Xcode project

·        Locate the libVuforiaMedia.a generated by Xcode upon build completion, and copy it to the Assets/Plugins/iOS folder (overwrite the existing one)

·        Close the Xcode project

·        Rename VideoPlayerHelper.m back to VideoPlayerHelper.m.txt

·        Rename the VideoPlayerWrapper.mm back to VideoPlayerWraper.mm.txt

·        Refresh and rebuild the VideoPlayback sample Unity project

 

Video texture playback iOS 9.2

December 10, 2015 - 4:53pm #7

I think I finally found some solution for the moment. I splitted the video and audio for the iOS version. Now it seems to work.

When I removed the sound from the video that was stuttering and not loading at first (black screen on first start) the issue was gone. Still not sure why/how this is caused by iOS 9.2

Building the release canditate for now and will see if I revert back in the future.

Video texture playback iOS 9.2

December 10, 2015 - 10:30am #6

Just noticed something new.

In my project I now have three instances of the video-prefab. At two of them I have the video which has issues (details were posted below in a screenshot). One version of the video is now with only 1200kbit via Handbrake tool. The third video is the video which works in my project.

I've made some debug-buttons to stop and start the videos like this:

case "DebugVideo1":
	debugVideo2.VideoPlayer.Pause();
	debugVideo3.VideoPlayer.Pause();
	debugVideo1.VideoPlayer.Play(false, debugVideo1.VideoPlayer.GetCurrentPosition());
	break;

Video3 is the working video, no problems. If I press the button, this video starts.
Now the new thing. If I press Video1 or Video2 for the first time, it's started, I can hear the sound, but still see no video. Within a frame or two the play icon is visible again. So it doesn't stay away like in Video3.

Is that a clue? Something is going wrong?!

Another thing: Let's say I start Video1. I don't see it, I hear the sound and the play icon is coming back immediately after I pressed it. Then I start Video3, so the command debugVideo1.VideoPlayer.Pause() is called. Video3 starts playing but nothing happens to Video1. I can still hear the sound. This is then only "reset" if I activate Video1. Then I can see the video and the sound is at the right spot. But the video is stuttering...

Video texture playback iOS 9.2

December 10, 2015 - 10:28am #5

New update:

The video which is not working correctly in our App is working fine in the video playback test sample.

Currently I'm making a new iOS build with a custom video plane, instead of the vuforia standard video plane. Although in the video playback sample the video is working with the custom video plane.

I didn't decrease the bitrate of the video yet, because it worked in the video playback test App. Not sure what I can do now. Fingers crossed that it works in the new build...

Video texture playback iOS 9.2

December 10, 2015 - 8:01am #4

Tried multiple things still no success. Using Unity Cloud Build and Version 5.2.2p3. Same as in my test project where the video file works fine.

Any dev here? Any idea why a black screen at the video on the first App start can appear?

Building another new version with different video files and "video"-prefab...

Thanks

Video texture playback iOS 9.2

December 10, 2015 - 3:12am #3

Some more results:

Now the iPad Mini 2 was updated to iOS 9.2. Also the behaviour described below could be reproduced on the iPhone 6:

The very first time after the App start the video is not shown. Screen stays black and the sound is played. I also see our triggered 3D models that are overlayed after specified timings to show information. Think about bubbles that have some text. So the video is played and thinks like this are working:

} else if (video.VideoPlayer.GetCurrentPosition() > 25.7333f && !anim02Playing) {

So the screen is black. If I now move away from the tracking marker and come back the video appears! It's also playing, but stuttering from time to time. Then it can also hang for several seconds, but the triggered 3D models are shown. It's a show-stopper right now!

Again, this worked until yesterday with iOS 9.1. Something has changed and I'm not sure if/how to fix it. Is it something with the video buffer? Does anyone have an idea what I can test? Is it something in the vuforia code I can change?

Please find attached details about the video.

I'll try to decrease the bitrate and test again. Thanks

AttachmentSize
Image icon 2015-12-10_video-details.png164.52 KB

Video texture playback iOS 9.2

December 10, 2015 - 2:49am #2

Ok, I tested on the iPhone (9.2) a test project where the vuforia video playback sample was used. There're two videos in that sample. One default and one from us where we tested a video with transparency. Both work in that setup.

I'm creating a new build and implemented the video which is not working to that sample project. We'll see if it works in that project. But I guess it somehow has to do with that video file. Though it was working with iOS 9.1

I'll update this thread once I have more info.

Topic locked