Search Unity

Question Multiple Videos in Scene

Discussion in 'Audio & Video' started by jandolina, Mar 1, 2021.

  1. jandolina

    jandolina

    Joined:
    Sep 5, 2019
    Posts:
    4
    Trying to skill up on Unity and ran into an issue with multiple videos. My scene has several signs that have small videos on them. Think tvs at a sports bar. Additionally I have a user controllable (start/stop) video on a flat panel display. The problem is that as soon as an additional video player is added, all videos in the scene start randomly rendering frames from every video in the scene. The project is targeted for oculus.

    Video set up
    Each video is being played with an individual video player
    It is using render texture method to render
    Each video has a corresponding material and video texture

    Is it possible to have multiple videos in the same scene?
    Is render texture the right video playback strategy?
    Is there a way to keep the video players and their output to be individual.
    Is there an example of this somewhere?
     
    Last edited: Mar 1, 2021
    viknesh2020 likes this.
  2. jandolina

    jandolina

    Joined:
    Sep 5, 2019
    Posts:
    4
    Anyone?
     
  3. Officialsteve

    Officialsteve

    Joined:
    Jun 11, 2019
    Posts:
    1
    I'd like an answer to this question too...
     
  4. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    If I understand correctly you are saying that when you add a VideoPlayer every VideoPlayer starts playing? What is your Editor version, your OS, and your GPU? If you can show a clip or share a project, it would help a lot.
     
  5. menguzar

    menguzar

    Joined:
    Jan 31, 2022
    Posts:
    10
    I also have this issue. If I have more than one video player in the scene, frames from videos that are playing are shown on the canvases of those that don't play. different materials, different textures, different videos but still videos play on every canvas with a videoplayer component.
     
  6. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    I tried reproducing on my side, but I couldn't reproduce the issue. Can you open a bug report so we can investigate the issue?
     
  7. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    @jandolina Did you solve this issue?. I am facing the same in one of my project.
     
  8. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    Upgrading the project to URP solved this issue. Seems weird. @The_Island To reproduce the issue, do the following,

    1. Create a new 3D project with editor version 2021.3.3f1.
    2. Add four planes in the scene with a render texture on each of the plane.
    3. Add video player in each plane and assign the render texture from its respective plane.
    4. Build it for android and check the output in the device.

    You will see each video's frames clash among themselves while playing. I am unable to submit a sample project as it is a client based project and I am tight on my schedule to recreate a new project. Hope the above steps will help you to recreate the issue.
     
    The_Island likes this.
  9. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Tried following your repro steps but I don't see the issues. I paused the 3 others player and played one in a loop. Each has there own render textures and own VideoPlayer. I am using the Core RenderPipeline on Android 12, Galaxy A50. https://drive.google.com/file/d/1xrgKWpB66Rgb_q1LG0uIKI2XmxiTNLy0/view?usp=sharing
     
    Last edited: Jun 8, 2022
  10. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    Can you try the same on an Oculus Quest 2 device? I thought the issue was common for all the android devices. Also, why only one video was playing on the screen record you shared? Or all the videos playing simultaneously?
     
  11. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Unfortunately, I don't have an Oculus Quest 2 device right now. I will try to ask a colleague if he can test it.
    The original issue was the player "randomly rendering frames from every video in the scene" so it is easier to see the rendering if some players are not running. I tried two different clips and still didn't see the issue. But again, I am on android, not Oculus Quest 2. I will reach out to someone.
     
    viknesh2020 likes this.
  12. Gilles_Baroin

    Gilles_Baroin

    Joined:
    Jan 26, 2022
    Posts:
    7
    Same case here Quest 2 : 5 videos projected on spheres and planes + alpha
    Was OK in Game Mode but blocked in Headset only ??

    solved by do as Viknesh said : one player/video
    Then re-import videos so that :
    - original size
    - override for Android
    - H264

    If still stuck , try re-encoding externally with a 2:1 ratio or traditional 1080p
    at least be sure to have multiple of 4 on video dimensions
    Unity will do the scaling
     
  13. arrezes

    arrezes

    Joined:
    Jul 12, 2014
    Posts:
    7
    I have two different planes. Each having their own materials and render texture and also playing two different videos. Previewing on oculus showed that only one video displayed and played on both planes but I can still hear the second video audio playing.

    Any workaround?
     
  14. Maryia_Ondra

    Maryia_Ondra

    Joined:
    Aug 26, 2020
    Posts:
    7
    I have the same issue with flickering videos but on an android device. maybe someone has a solution?
     
  15. olcaytoibili

    olcaytoibili

    Joined:
    Feb 25, 2016
    Posts:
    2
    I'm still having this issue. I've tried encoding it but everything messed up on headset.
     
  16. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    Are you using URP? or the default one? This issue got solved for me when I upgraded my project to URP.
     
  17. rakeshparihar

    rakeshparihar

    Joined:
    Oct 1, 2015
    Posts:
    4
    Does this issue resolve for Oculus Quest 2 ?
     
  18. viknesh2020

    viknesh2020

    Joined:
    Jul 19, 2016
    Posts:
    52
    Yes.
     
  19. Elsie7ex

    Elsie7ex

    Joined:
    Apr 27, 2020
    Posts:
    1
    KnewK likes this.
  20. KnewK

    KnewK

    Joined:
    Sep 2, 2012
    Posts:
    19
    Unchecking Low Overhead Mode worked for me.
     
  21. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    It seems it was fixed in 2023.2.0a1, 2023.1.0b8, 2022.2.7f1, 2021.3.21f1 and 2020.3.48f1. If you are still experiencing this behaviour after upgrading we would really like a bug report. Otherwise, unchecking Low Overhead Mode seems to be a nice workaround.
     
  22. LuciaFt

    LuciaFt

    Joined:
    Jan 24, 2020
    Posts:
    1
    I had this issue and my problem was that even tho I was using different render textures for each video player, I created each render texture by control+D the first one instead of creating them from 0.
    I solved it by deleting all render textures and creating new ones one by one.
    Hope this can help someone else ^^