• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
2
Question by redgreenbob · Jan 30, 2018 at 06:06 AM · videoblackclips

VideoPlayer black frames between clips.

I am attempting to switch between a series of mp4 movies with a simple 2D interface. I am running into an issue that I hope I can work around to. When switching video clips, I get several black frames.


I have tried several switching methods (camera switch, scene switch, video player switch and clip array swaps) for jumping to different content in the cameras far plane. Pausing the clip does not seem to help. On a switch, I am getting black frames.


I understand I have to wait for the next movie to load, the content is built for a delay. Is there a way to avoid the player going to black during the transition? Can I capture the far plane and display the last good frame in the near plane during the transition? Is my method incorrect?


The following script is the structure I would prefer to use if I can find a solution to the black frames, I have simplified it to include only the video setup:


 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.Video;
 
 [RequireComponent(typeof(VideoPlayer))]
 
 public class stageTools_clean : MonoBehaviour {
     public VideoClip[] vids;
     private VideoPlayer vp;
     private int ii = 0;
 
     // Use this for initialization
     void Start () {
         vp = gameObject.GetComponent<VideoPlayer>();
         vp.clip = vids[0];
     }
 
     public void PlayVideo(int id)
     {
         if (id<0 || id >= vids.Length)
         {
             id = 0;
             ii = 0;
         }
         vp.Pause();
 
         vp.clip = vids[id];
         vp.Play();
     }
     
     // Update is called once per frame
     void Update () {
 
         if (Input.GetMouseButtonDown(0))
         {
             ++ii;
             PlayVideo(ii); 
         }
     }
 }

alt text


Thanks in advance for your help...



unityclipscreen.jpg (127.7 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image asger60 · Aug 13, 2018 at 07:50 AM 0
Share

I have the same problem, did you ever fint a solution?

avatar image ABerlemont · Mar 19, 2019 at 12:28 PM 0
Share

Same here. I'm considering having two VideoPlayer and one pausing before the next clip is ready in the second VideoPlayer ...

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

127 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I can't upload some quind of movies 0 Answers

Play only selected video 0 Answers

¿PLAY and Pause with Gear Vr button Video 360? 0 Answers

Video Player & GearVR? 1 Answer

Is it possible to record someone and import it as an animation? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges