Unity3d playback of high quality video solutions

Source: Internet
Author: User

1.

Unity3d Playback High quality video Solutions ~

Recently in tossing a video game. Really is a video game, the main background of the game is a big video. You may switch between three or four videos and need to switch seamlessly.

The platform is Android, the core piece is rockclip. Find a variety of plugins.

    1. Movietexture, can only play Ogg and OVG, and the quality is relatively low. If you want to turn into a high-quality video, the file size is larger. Give up, keep looking.
    2. Easymovietexture, some black drops on the machine ~ compatibility is not good, continue to find.
    3. Avipro, is this name, and finally found only on iOS. Keep looking.
    4. Vuforia video playback (below using VVP instead) comes with a video playback in the SDK for Qualcomm. Took it out, changed it to use.

But there are some problems here, by the way, to the students who need it later:

    1. Play the video giant card on the SD card. Is it a machine problem? (did not try on the phone, have tried to tell me the classmate trouble.) I looked at the log, where the bleeding was. Actually, it's not really an error. Why? =.=
    2. The VVP bottom is played using MediaPlayer. The principle is probably to play on a subface, then draw on a texture, use this texture in unity3d.
      1. If you are using a video in the Streamasset directory, Playertype will be equal to 3, using Awsomeplayer
      2. If the video is on the SD card, Playertype==7 uses Ffplayer. The use of Ffplayer will be very slow and big card.

        Due to the use of JMI, I am not familiar with the specific debugging bottlenecks where. On the Vuforia forum, it is no one's natural bird. I finally downloaded the Android source code, want to take time to see, and finally did not toss. Know the classmate told me a loud ha.

    3. Playback mode. I started two vvp to play 6 videos, a play 1,b play 2,a play 3, and so on. Then the direct flash back. OMG. This problem does not occur when I use MediaPlayer directly on Android.

      So I reasoned that the memory side was exposed ~ later changed to 6 VVP to play 6 videos. Since it is necessary to play different 6 videos in this scene several times, it seems that the flashback is only a matter of time.

      I asked again in the Vuforia forum, and for granted, no one bird. (PS: I saw a problem in the Vurofria forum that one of the goods brushes a screen ...)

    4. Kari ~ things add more, CD did not go up, but still card. All aspects. VVP is also a direction. The following solution is not a bird.

The Final Solution:

Use the Unity3d 4.2 version. This version can be set u3d Subfaceview in eclipse to be transparent. This is displayed along with the native elements.

Well, I was thinking about that, and then GG came out of the results.

Thank the predecessor of the tree, otherwise this project I will be planted =.= is definitely a variety of unstable factors.

I set subfaceview transparency in eclipse, which is easy to do. Then add a videoview to the view. Generate jar and drop it into u3d. (Well, everyone should be.) If you don't leave a message, I'll drop the code.

Videoview can load a variety of video, high quality, not flash back, but also to play the video on the SD card, performance has improved. The performance provides 300% also stable.

If you are a student who needs video in a small area, use the code to control the location of the video entirely. Of course this is my assumption. There should be other problems in the real implementation.

OLE, the first blog to write the story of the garden feel free to write here. c U.

PS: The editor here is really not good, and there is no u3d classification =.=

Test Project: http://download.csdn.net/detail/netfly53541314/9541212

Note: There are only examples of Android in this test project. iOS can do the same, please GG for details.

Unity3d playback of high quality video solutions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.