Search Unity

[Released] AVPro Video - complete video playback solution

Discussion in 'Assets and Asset Store' started by AndrewRH, Feb 12, 2016.

  1. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 2.3.1 has just been released!

    Changes include:

    Android
    • Improvements
      • Updated ExoPlayer from version 2.16.0 to 2.16.1
    • Fixes
      • Fixed CPU architecture setting for new X86_64 plugins introduced in version 2.3.0

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)​

    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Thanks,
     
  2. Serhii-Horun

    Serhii-Horun

    Joined:
    Apr 12, 2015
    Posts:
    151
    Hey, Andrew!

    We got one issue related network connections and AVPro. We have noticed if user loose wifi connection and being switched to cellular phone internet(4G), then next video streams can't be loaded. And that seems due to reusing of connections. We have tried to add header Connection Close, but it doesn't seem solve the issue.

    Any ideas what is going on and what we can do?

    Thanks!
     
  3. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Which platform is this happening on?
    Could you start an issue on our Github issues pages so our support team can investigate please?

    Thanks,
     
    Serhii-Horun likes this.
  4. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    Hi @NathanRH
    Can we use your plugin for playing podcasts?
     
  5. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    It depends on the format of the podcast.

    If it's a direct URL to an MP3 file - then yes, or a HLS stream - then yes.

    If it's another format then it will depend. Let me know more information and I will be able to give a better answer.

    Thanks,
     
    jGate99 likes this.
  6. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,941
    Its a direct url to mp3
     
  7. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Yes that should work just fine then.
     
  8. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    Hello @NathanRH!

    I'm having an issue getting positional audio to work on my VR project. I'm using the ExoPlayer API (Audio Ouput setting set to Unity) and AudioOutput component, with my AudioSource's Spatial Blend set to 1 for 3D audio. But the AVPro video still pipes the audio to the headset as if it is 2D audio, it doesn't matter where the player is in relation to the AudioSource. The overall volume of the AudioSource is affected by its distance away from the player however.

    Any ideas on what could be going wrong?

    Thanks for your help!

    Edit: I'm using v.2.2.2 if that's helpful
     
    Last edited: Jan 13, 2022
  9. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @jordan_subvrsive

    Some things you could try:
    • In the Media Player inspector, set Audio Output to 'Unity' (Platform Specific -> Android -> Audio Output) (note, you'll need to set this for Windows/Mac if you're testing in the editor)
    • Add an AudioOutput component to your AudioSource object and assign the Media Player
    • Tick the 'Support Positional Audio' box in the Audio Output inspector
    Does that help?
     
  10. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    As noted in the original post, I've configured the Audio Output setting to 'Unity' and hooked up an AudioOutput component to the Media Player. I don't see the 'Support Positional Audio' box in the AudioOutput inspector of the script however, I only see the below:
    upload_2022-1-17_10-7-20.png
    I see that the Audio Output documentation talks about this 'Support Positional Audio' tickbox, but also shows a picture similar to mine above of the Inspector view of the script. Where can I enable this option? Do I need to update my version of AVPro Video?
     

    Attached Files:

  11. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    This option was only added in version 2.3.0. Which version are you using currently?
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 2.3.2 has just been released!

    Changes include:

    Windows
    • Improvements
      • NotchLC decoder now supports D3D12
      • Added audio delay feature for Media Foundation (currently only supported when using Frame Buffering)
    • Changes
      • Entire low-level rendering pipeline rewritten
    Android
    • Improvements
      • #1045 Ability to change audio subsystem prior to opening a video
      • #1045 Ability to change Facebook 360 channel mapping prior to opening a video
    • Fixes
      • Fixed proguard keep list
      • #1063 Fixed IsMediaCachingSupported always returning false
      • #1044 Fixed a hole in the nativeDestroy chain of code
    macOS/iOS/tvOS
    • Improvements
      • HLS group names no longer show "Unknown" when locale data isn't present
    iOS
    • Fixes
      • #1043 Fixed issue with audio sounding garbled when playing back an asset with more than two channels of audio when using Unity audio mode

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)
    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Thanks,
     
  13. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 2.3.3 has just been released!

    Changes include:

    Android
    • Fixes
      • Fixed crash bug introduced in 2.3.2 when destroying a MediaPlayer

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)​
    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Thanks,
     
  14. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    @AndrewRH Thanks for the reply, we were able to get positional audio working successfully after updating to 2.3.0!

    Another question I have is related to how videos are handled right after they are played. I see that upon a video being finished, it seeks to the first frame of the video to await. Is there a way to stop this seek so that the video just pauses forever at the last frame when the video is finished?
     
  15. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    122
    Hi
    Also getting positional audio working and looking forward to properly implementing it into my app :)

    I do have a problem with the latest update though that wasn't appearing before. The video plane I have the video texture set too appears to show clipping as it gets further away from the camera until it's completely gone. This isn't occurring in previous versions and also when you switch on "Use Resampler" that also fixes it.

    I can provide examples if you need them.

    All the best

    Phil
     
  16. wrensey

    wrensey

    Joined:
    Mar 12, 2017
    Posts:
    15
    Hello!

    I am trying to implement live streaming into my app and this feels like a really basic question since I can't find any information on it online, but how do create a HLS/.m3u8 link from an online stream? I cannot figure this out
     
  17. Bowie-Xu

    Bowie-Xu

    Joined:
    Sep 14, 2011
    Posts:
    28
    Hi AndrewRH
    Is there any way to play a growing byte buffer?
    Basically, I am trying to implement a Vysor in the Unity editor. There is an open-sourced project called Scrcpy (https://github.com/Genymobile/scrcpy). The server runs on Android and sends H.264 raw data over the TCP protocol. On the Unity Editor side, I can receive all these bytes, write them into a file and use OpenMediaFromBuffer to play it later on without any problem. Now I want to kind of play the TCP streaming in real-time.

    The code like this:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using System;
    4. using UnityEngine;
    5. using System.Diagnostics;
    6. using System.Net;
    7. using System.Net.Sockets;
    8. using System.Threading;
    9. using System.IO;
    10. using Debug = UnityEngine.Debug;
    11. using RenderHeads.Media.AVProVideo;
    12.  
    13. public class ScrcpyController : MonoBehaviour
    14. {
    15.     readonly int buffersize = 48000;
    16.     int currentbuffersize = 0;
    17.  
    18.     bool existing = false;
    19.     bool startPlay = false;
    20.     public MediaPlayer mediaPlayer;
    21.     Queue<byte[]> bufferQueue = new Queue<byte[]>();
    22.     byte[] currentBuffer = null;
    23.  
    24.     // Start is called before the first frame update
    25.     void Start()
    26.     {
    27.         string projectPath = Application.dataPath;
    28.         //start thread to receive data
    29.         Thread receivingThread = new Thread(new ThreadStart(() => ReceiveThread(projectPath)));
    30.         receivingThread.Start();
    31.  
    32.         Thread commandThread = new Thread(new ThreadStart(() => PushAndStartScrcpyServer(projectPath)));
    33.         commandThread.Start();
    34.  
    35.  
    36.     }
    37.  
    38.     // Update is called once per frame
    39.     void Update()
    40.     {
    41.         if (Input.GetKeyDown(KeyCode.Q))
    42.             existing = true;
    43.  
    44.      
    45.         if(bufferQueue.Count > 0)
    46.         {
    47.             byte[] buf = null;
    48.             lock (bufferQueue)
    49.             {
    50.                 buf = bufferQueue.Dequeue();
    51.             }
    52.  
    53.             if (startPlay == false)
    54.             {
    55.                 startPlay = true;
    56.                 mediaPlayer.OpenMediaFromBuffer(buf);
    57.                 //mediaPlayer.StartOpenChunkedMediaFromBuffer(0);
    58.  
    59.             }
    60.             else
    61.             {
    62.                 mediaPlayer.AddChunkToVideoBuffer(buf, 0, (ulong)buf.Length);
    63.             }
    64.              
    65.         }
    66.      
    67.  
    68.     }
    69.  
    70.     void PushAndStartScrcpyServer(string path)
    71.     {
    72. #if UNITY_EDITOR
    73.         Process process = new Process();
    74.         ProcessStartInfo ps = new ProcessStartInfo();
    75.  
    76.         ps.WindowStyle = ProcessWindowStyle.Normal;
    77.         ps.CreateNoWindow = true;
    78.         ps.UseShellExecute = false;
    79.         ps.RedirectStandardOutput = true;
    80.         ps.RedirectStandardError = true;
    81.  
    82.         process = new Process();
    83.         ps.FileName = "adb.exe ";
    84.         ps.Arguments = "disconnect";
    85.         process.StartInfo = ps;
    86.         process.Start();
    87.         Debug.Log(process.StandardOutput.ReadToEnd());
    88.         Debug.Log(process.StandardError.ReadToEnd());
    89.         process.Close(); process.Dispose();
    90.  
    91.         process = new Process();
    92.         ps.FileName = "adb.exe ";
    93.         ps.Arguments = "connect " + "192.168.1.232";
    94.         process.StartInfo = ps;
    95.         process.Start();
    96.         Debug.Log(process.StandardOutput.ReadToEnd());
    97.         Debug.Log(process.StandardError.ReadToEnd());
    98.         process.Close(); process.Dispose();
    99.  
    100.         process = new Process();
    101.         ps.FileName = "adb.exe ";
    102.         ps.Arguments = "reverse " + "--remove-all";
    103.         process.StartInfo = ps;
    104.         process.Start();
    105.         Debug.Log(process.StandardOutput.ReadToEnd());
    106.         Debug.Log(process.StandardError.ReadToEnd());
    107.         process.Close(); process.Dispose();
    108.  
    109.         process = new Process();
    110.         ps.FileName = "adb.exe ";
    111.         ps.Arguments = "forward " + "--remove-all";
    112.         process.StartInfo = ps;
    113.         process.Start();
    114.         Debug.Log(process.StandardOutput.ReadToEnd());
    115.         Debug.Log(process.StandardError.ReadToEnd());
    116.         process.Close(); process.Dispose();
    117.  
    118.         process = new Process();
    119.         ps.FileName = "adb.exe ";
    120.         ps.Arguments = "push " + path + "/scrcpy-server " + "/data/local/tmp/scrcpy-server.jar";
    121.         process.StartInfo = ps; process.Start();
    122.         Debug.Log(process.StandardOutput.ReadToEnd());
    123.         Debug.Log(process.StandardError.ReadToEnd());
    124.         process.Close(); process.Dispose();
    125.  
    126.  
    127.         process = new Process();
    128.         ps.FileName = "adb.exe ";
    129.         ps.Arguments = "reverse " + "localabstract:scrcpy " + "tcp:27183";
    130.         process.StartInfo = ps; process.Start();
    131.         Debug.Log(process.StandardOutput.ReadToEnd());
    132.         Debug.Log(process.StandardError.ReadToEnd());
    133.         process.Close(); process.Dispose();
    134.  
    135.         process = new Process();
    136.         ps.FileName = "adb.exe ";
    137.         ps.Arguments = "shell " + "CLASSPATH=/data/local/tmp/scrcpy-server.jar " +
    138.             "app_process " + "/ " + "com.genymobile.scrcpy.Server " +
    139.             "1.12.1 " + "1024 " + "8000000 " + "0 " + "false " + "- " + "false " + "false";
    140.         process.StartInfo = ps; process.Start();
    141.         Debug.Log(process.StandardError.ReadToEnd());
    142.         Debug.Log(process.StandardOutput.ReadToEnd());
    143.         Debug.Log(process.StandardOutput.ReadToEnd());
    144.         process.WaitForExit(); process.Close(); process.Dispose();
    145.  
    146.         Debug.Log("PushAndStartScrcpyServer end");
    147. #endif
    148.     }
    149.  
    150.     void ReceiveThread(string path)
    151.     {
    152.         TcpListener server = null;
    153.  
    154.         Int32 port = 27183;
    155.         IPAddress localAddr = IPAddress.Parse("127.0.0.1");
    156.         server = new TcpListener(localAddr, port);
    157.         TcpClient client = null;
    158.         NetworkStream stream = null;
    159.  
    160.         byte[] bb2 = new byte[64];
    161.         byte[] bb3 = new byte[4];
    162.         byte[] bb4 = new byte[12];
    163.         server.Start();
    164.  
    165.         while (existing == false)
    166.         {
    167.  
    168.             Debug.Log("Waiting for a connection Server No.1---------- ");
    169.             client = server.AcceptTcpClient();
    170.             Debug.Log("Connected!========>1");
    171.             stream = client.GetStream();
    172.  
    173.             BufferedStream bf = new BufferedStream(stream);
    174.  
    175.             bf.Read(bb2, 0, bb2.Length);
    176.  
    177.             Debug.Log(System.Text.Encoding.ASCII.GetString(bb2, 0, bb2.Length));
    178.  
    179.             bf.Read(bb3, 0, bb3.Length);
    180.             Debug.Log(System.Text.Encoding.ASCII.GetString(bb3, 0, bb3.Length));
    181.  
    182.             currentBuffer = new byte[buffersize];
    183.             currentbuffersize = 0;
    184.             int readcount = bf.Read(bb4, 0, bb4.Length);
    185.             bb4.CopyTo(currentBuffer, currentbuffersize);
    186.             currentbuffersize += readcount;
    187.             FileStream fs = File.Create(path + "/../Test.mp4");
    188.        
    189.             if (fs != null)
    190.                 fs.Write(bb4, 0, readcount);
    191.  
    192.  
    193.             while(readcount > 0 && existing == false)
    194.             {
    195.  
    196.                 readcount = bf.Read(bb4, 0, bb4.Length);
    197.                 if (currentbuffersize + readcount < buffersize)
    198.                 {
    199.                     bb4.CopyTo(currentBuffer, currentbuffersize);
    200.                     currentbuffersize += readcount;
    201.                     if (currentbuffersize == buffersize)
    202.                     {
    203.                         lock (bufferQueue)
    204.                         {
    205.                             bufferQueue.Enqueue(currentBuffer);
    206.                         }
    207.  
    208.                         currentBuffer = new byte[buffersize];
    209.                         currentbuffersize = 0;
    210.                     }
    211.                 }
    212.                 else
    213.                 {
    214.                     int overlength = currentbuffersize + readcount - buffersize;
    215.                     int leftsize = readcount - overlength;
    216.                     if(leftsize > 0)
    217.                     {
    218.                         Array.Copy(bb4, 0, currentBuffer, currentbuffersize, leftsize);
    219.  
    220.                         currentbuffersize += leftsize;
    221.                         if(currentbuffersize == buffersize)
    222.                         {
    223.                             lock (bufferQueue)
    224.                             {
    225.                                 bufferQueue.Enqueue(currentBuffer);
    226.                             }
    227.  
    228.                             currentBuffer = new byte[buffersize];
    229.                             currentbuffersize = 0;
    230.                         }
    231.  
    232.                     }
    233.  
    234.                     if (overlength > 0)
    235.                     {
    236.                         Array.Copy(bb4, leftsize, currentBuffer, currentbuffersize, overlength);
    237.                         currentbuffersize += overlength;
    238.  
    239.                         if (currentbuffersize == buffersize)
    240.                         {
    241.                             lock (bufferQueue)
    242.                             {
    243.                                 bufferQueue.Enqueue(currentBuffer);
    244.                             }
    245.  
    246.                             currentBuffer = new byte[buffersize];
    247.                             currentbuffersize = 0;
    248.                         }
    249.                     }
    250.                          
    251.  
    252.                 }
    253.  
    254.                 if (fs != null)
    255.                     fs.Write(bb4, 0, readcount);
    256.              
    257.                 bf.Flush();
    258.             }
    259.  
    260.             if (fs != null)
    261.             {
    262.                 fs.Flush();
    263.                 fs.Close();
    264.             }
    265.              
    266.         }
    267.  
    268.         Debug.Log("ReceiveThread end.");
    269.      
    270.     }
    271. }
    272.  
    I can also use OpenMediaFromBuffer to open the buffer and display the first frame, but it froze after that. Seems OpenMediaFromBuffer can only decode the initial buffer's content and ignore all other coming buffer added by AddChunkToVideoBuffer function.

    Any hints?

    You can download scrcpy server here: https://github.com/Genymobile/scrcpy/releases/download/v1.12.1/scrcpy-server-v1.12.1

    Rename it to 'scrcpy-server' and push it to an Android phone to give it a try.

    Thanks in advance.

    Bowie
     
    Last edited: Jan 27, 2022
  18. amoghaltoura

    amoghaltoura

    Joined:
    Sep 16, 2021
    Posts:
    1
    Hi,

    We are getting DllNotFoundException: AVProVideo when trying to play video from local storage in Mac platform.
    Unity version 2020.3.21f1
    AVPro version 1.11.6

    video is in mp4 format, which is stored locally

    Using Macbook Pro, macOS Big Slur 11.1
     
  19. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    That's strange - it should stop on the last frame unless set to loop. You sure you haven't altered/added any code?
     
  20. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @phileday,

    Would you mind adding a bug report for this on our Github please? It would be useful if you could include screenshots and any other info that might be useful to reproduce such as: Are there any project settings you've adjusted? Do you have mipmaps enabled?

    Thanks!
     
  21. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @Bowie-Xu,

    We don't support anything like this unfortunately. The OpenMediaFromBuffer method is only supported when using DirectShow API on Windows, and is a slightly different thing in any case.
     
  22. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @amoghaltoura,

    We see you've posted this on our Github as well. Will continue support there.
     
  23. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    122
    @TerryRH

    I've submitted the bug report and yes I did have generate mipmaps on and when turning them off that also fixed the issue :)

    Phil
     
    NathanRH likes this.
  24. housainsouhail

    housainsouhail

    Joined:
    Jul 18, 2017
    Posts:
    1
    Hello everyone , Im trying the last trail version of AVPro with Oculus quest 2 and I have a problem .
    Currently Im getting a link of live streaming from youtube link then playing it with the AVPro path/Url solution media player .
    all work in the editor but in the Oculus quest 2 the game run but the screen remains blank . and nothing appears also I hear nothing from the game itself . so either there is an error in getting data or the plugin did not run at all .
    Currently here is the details and what I did :
    I use unity 2020.3.25
    I use Oculus quest 2
    I try to build with this settings like you advice everyone :
    upload_2022-2-1_4-8-5.png
    I have the plugins installed and also I modified the grade file like in description
    Stil I have those errors in the device log

    AndroidJavaException: java.lang.ClassNotFoundException: com.renderheads.AVPro.Video.Manager

    java.lang.ClassNotFoundException: com.renderheads.AVPro.Video.Manager

    upload_2022-2-1_4-9-38.png
    Im not sure about the main problem here but I would really appreciate if there is a solution for this
    thank you everyone .
     
  25. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi,

    We see you've also posted on our Github. Will continue correspondence there.
     
  26. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    We just updated/redownloaded AVPro to remove any unintended code changes, the issue is still there. We're using v.2.3.3 now, and enabled the Auto Open and Auto Play options. Loop is not enabled. Also using the Apply to Mesh component in case that matters.
     
  27. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    If you open one of the demo scenes, e.g. Demo_MediaPlayer and turn off loop in the component, do you still see this issue? From our side it's pausing on the last frame.

    If not it would be useful to then try this in a fresh project to see if we can isolate the issue.
     
    Last edited: Feb 3, 2022
  28. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 2.4.0 has just been released!

    Changes include:

    macOS/iOS/tvOS
    • Improvements
      • #1070 HEVC+Alpha now supported
    iOS
    • Fixes
      • #1073 Fixed issue with texture update not happening whilst a native UI element is tracking the input

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)
    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Thanks,
     
  29. frangagn

    frangagn

    Joined:
    Sep 20, 2018
    Posts:
    53
    Hi Andrew.

    I just purchased a new PC and ported my Unity project on it: reinstalled unity, copied the project files. When opening the project on the new computer (Windows 11), I'm getting about 18 errors from the file "windowsmediaplayer_bufferedframes.cs". I tried updating AVPRO from the Asset Store, but I still get the errors... I know one solution would be to uninstall AVPRO Video and reinstall it... but I'm trying to avoid this since it would mean rewiring a bunch of stuff...

    The project was developed with Unity 2019.4.f1

    Here are some of the errors, ever heard of this?

    https://prnt.sc/26omdzf
     
  30. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi @frangagn

    When you tried to update did you follow these steps?
     
  31. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    Hi, how can i swap stereo eyes in version 1 for ApplyToMesh and DisplayuGUI?
    Meaning when i turn on stereo debug tinting, i want to see red on the left and green on the right.

    I've been getting messages from users saying that there are videos out there that are packed incorrectly, and some apps have added a way to swap eyes to compensate.

    I need to do this via stereo script or shader (however it's being assigned by avpro). I have a custom VR head rig with dual cameras, and i can't do it by switching the eye mode of the camera (if that would even work) because the app depends on having it set to none.

    Thanks
     
  32. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi there,

    If you look at the file AVProVideo.cginc - you'll see a method 'IsStereoEyeLeft'. If you wish to switch eyes, you'd need to invert all the logic within that method.

    Does that help?
     
  33. blevok

    blevok

    Joined:
    Feb 16, 2017
    Posts:
    75
    Yes, that's exactly what i was looking for. I reworked it with an if/else to allow the user to change it at will with a UI button, and I had to jump through some additional hoops to make it take effect during runtime, but it's working perfectly now.
    Thanks
     
    seabits likes this.
  34. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    Thanks for the help. Turns out it was the source file, it was slightly corrupted which led to some weird behaviour.

    Another question I have is if it is possible when using the Display UGUI component to somehow get a reference to the actual rectangle that is rendering the video. What I mean is that if the UI component that has the Display UGUI component is square, and then I render a rectangular video (1920x1080) onto the component, I'd like to have the ability to know the boundaries of this rectangle.

    Please let me know your thoughts! Thank you. :)
     
  35. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Not sure what you mean, could you perhaps include some screenshots to demonstrate?
     
  36. jordan_subvrsive

    jordan_subvrsive

    Joined:
    Aug 2, 2021
    Posts:
    11
    Sure! See below:
    upload_2022-2-17_15-53-24.png

    Just like how you can view the rectangular UI selection outline for the rect transform of the GameObject this video is being rendered on, I'd like to know the rect transform (or equivalent) of the actual video being rendered within the boundaries of the UI component. It'd be very useful for us since we are showing multiple videos in a row, all of which are different resolutions/aspect ratios, and we'd like the video controls UI we've made to dynamically snap to be at the bottom of the video.
     
  37. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Thanks for the explanation.

    Perhaps anchoring the rect transform could help? You could set the Display uGUI to anchor to the bottom for example.

    Otherwise, in DisplayUGUI.cs, there is this method: GetDrawingDimensions(ScaleMode scaleMode, ref Rect uvRect), which returns a vector4 which is the size of the video rendering.

    Does that help?
     
  38. ricvail

    ricvail

    Joined:
    Jun 5, 2016
    Posts:
    2
    Hi, I'm trying to render a 360° video loaded from disk (via absolute path) on the skybox, using the Apply to Material component.
    The video seems to be loading correctly, but I keep seeing the "default texture" that's supposed to be displayed while the video is loading. I know that the video is playing because I can hear the audio, and I can see it playing in the preview of the Media Player component, and in the material preview in the Unity inspector. But in the "scene" and "game" view I still see the default texture. What am I doing wrong?

    Also, I have a question: is there a way to get AVPro to load the whole video in the RAM before starting to play it, instead of streaming it from disk?
     
  39. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Have you tried loading your video in the Demo_360 scene? Does it still happen?
     
  40. ricvail

    ricvail

    Joined:
    Jun 5, 2016
    Posts:
    2
    No, it works in the demo scene. I've also managed to get it to render on the skybox material in the demo scene. The main difference is that in my scene I load and launch the video from code, and that I set the skybox material dynamically (sometimes we have to display a static image instead of a video, and we use a different material for that)

    EDIT: Nevermind, I figured it out: in the Awake method we created a copy of the material, and when we dynamically applied the skybox material we applied the cloned one, while the Apply to material component was still rendering on the original one. Thanks for the support anyway!
     
    Last edited: Feb 22, 2022
    seabits likes this.
  41. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    There is no support for ngui in version 2.4.0. Ngui is still a widely used plug-in. I hope to support it. Thank you! Our project does not use ugui because we think ngui is better. Or provide relevant interfaces or templates to quickly access third-party UI plug-ins. For example, if I change the UI scheme of fgui, how can I quickly access?
     
  42. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    What trouble are you running into exactly? Could you provide a more detailed description? Did you not experience this issue prior to 2.4.0?
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi All,

    AVPro Video version 2.4.1 has just been released!

    Changes include:

    Windows
    • Fixes
      • #1083 Fixed issue where texture mipmaps were not generated resulting in invisible videos when downscaled. This was a regression introduced in version 2.3.2
      • #1108 Fixed Hap videos displaying too dark in gamma colorspace. This was a regression introduced in version 2.3.2
      • #1110 Fixed bug where WinRT plugin wouldn't display subtitles
      • Fixed WinRT plugin version number to match expected value

    Download Links

    Editions

    On the Unity Asset Store we've made several editions of AVPro Video available so you can pick the one that's best for your project:

    Core Edition
    Ultra Edition
    • Enterprise Edition (contact us for multi-site licensing / support options)​

    You can read this page to learn more about the features, pricing and upgrades for the different editions.

    DOWNLOAD THE FREE TRIAL VERSION HERE

    Thanks to everyone who reported bugs or feature requests! We're looking forward continuing to support this product into the future and adding more features.

    Thanks,

    Thanks,
     
    Last edited: Feb 28, 2022
  44. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    AVPro Video + UniWebView 4 builds Andorid and reports Gradle error, delete AVPro Video Plugins/Android/guava-27.1-android.jar The error disappears, but the APP crashes, I think it should be caused by the conflict with the library file of UniWebView 4, this How to solve the problem?
    Environment:
    Unity 2021.2.13f1
    AVPro Video - Core Edition 2.4.0
    UniWebView 4 4.10.3
    Error:
    Code (CSharp):
    1. CommandInvokationFailure: Gradle build failed.
    2. D:\Program Files\Java\jdk1.8.0_301\bin\java.exe -classpath "D:\Program Files\Android\Gradle\gradle-6.1.1\lib\gradle-launcher-6.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
    3.  
    4. stderr[
    5. Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
    6. Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
    7. Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
    8. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    9. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    10. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    11. Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
    12. Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
    13. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
    14. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
    15. Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
    16.  
    17. FAILURE: Build failed with an exception.
    18.  
    19. * What went wrong:
    20. Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
    21. > 1 exception was raised by workers:
    22.   java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-27.1-android.jar (guava-27.1-android.jar) and jetified-listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)
    23.  
    24.   Go to the documentation to learn how to Fix dependency resolution errors.
    25.  
    26.  
    27. * Try:
    28. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    29.  
    30. * Get more help at https://help.gradle.org
    31.  
    32. BUILD FAILED in 962ms
    33. ]
    34. stdout[
    35.  
    36. > Configure project :launcher
    37. WARNING: The option setting 'android.enableR8=false''UnityEditor.Build.BuildFailedException' was thrown.
    38. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <6e0cfa050ed8432582865b49956bcd16>:0)
    39. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <6e0cfa050ed8432582865b49956bcd16>:0)
    40. UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at <6e0cfa050ed8432582865b49956bcd16>:0)
    41. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <6e0cfa050ed8432582865b49956bcd16>:0)
    42. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <db8aad8fcedd4e11ba6ba696cb8802a7>:0)
    43. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    44.  
    20220301110208.png 20220301110001.png 20220301110341.png 20220301110446.png 20220301110727.png
     
  45. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Could you try excluding it rather, as per this link?
     
  46. yangkairong

    yangkairong

    Joined:
    Aug 20, 2015
    Posts:
    16
    I have studied and solved it. I am not familiar with the Android platform and spent a day to solve this problem. Hope to help developers who encounter the same problems.

    Solution:

    1. Delete AVProVideo\Runtime\Plugins\Android\guava-27.1-android.jar;

    2. Player Settings -> Publishing Settings -> Build -> Custom Main Gradle Templete Checked;

    3. Edit the Assets\Plugins\Android\mainTemplate.gradle file and modify dependencies to:

    Code (JavaScript):
    1.  dependencies {
    2.    implementation fileTree(dir: 'libs', include: ['*.jar'])
    3.    implementation("com.google.guava:guava:31.0.1-android")
    4.    **DEPS**}
    4. Continue to compile, if the compilation reports an error, restart Unity and try again;

    5. Guava: Google Core Libraries for Java issue resolved.
     
  47. adeward

    adeward

    Joined:
    Mar 1, 2013
    Posts:
    9
    I'm having unusual difficulties getting Display uGUI to work out the box playing a QuickTime ProRes 4444 with Alpha video I've made. The video always appears to be invisible (it is playing, I can hear the audio). I can use Display IMGUI just fine, that behaves perfectly, but uGUI is just always invisible. If I switch my Scene view to Render Paths, the video appears (see screenshot), so I know the source video is fine - there is something broken about uGUI in 2.4.1. Playing a regular H264 encoded MP4 video also seems to work okay, as does ProRes 422. This does appear to be specific to ProRes 4444.

    I note that there was a Windows bug fix about mipmaps in 2.4.0 causing video to be invisible, so I wonder if it's related? I'm on macOS (AVPro Video v2.4.1 (native plugin v2.4.0-ultra build 1159) on Apple M1 Pro/Metal (MT True) on OSXEditor). Using Unity 2020.3.30f1 on macOS 12.1 (21C52).

    Any clues as to why this might be the case?

    Unfortunately, I do need alpha support, and due to the 4K quality required, ProRes 4444 is the ideal format, so I'd like to not compromise on that.

    upload_2022-3-8_15-4-13.png
     
  48. seabits

    seabits

    Joined:
    Dec 3, 2019
    Posts:
    199
    Hi there,

    Would you mind posting this on our Github as a bug report? We prefer that mode of communication for this kind of issue that will require some investigation and back and forth. It would be helpful if you could include some sample media as well so we can try reproduce it.

    Thanks!
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    If you could send us the video (or a clip of it) we can try to reproduce the issue and investigate. You can either email us (unitysupport@renderheads.com) the file if you wish, or post it on our Github Issues page where our support team lurks.

    Thanks,
     
  50. Riken_rds

    Riken_rds

    Joined:
    Apr 4, 2017
    Posts:
    49
    hello thanks for provide amazing video playback package.
    but i am using latest ultra package and i am trying to play video with url on windows or android but i am getting this error and my video is can't playing please check and find any issue then let me know

    [AVProVideo] Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources

    hear is my video url

    https://s3-congnito-file-upload-demo.s3.ap-southeast-1.amazonaws.com/3021.014pickedMedia1.mov