Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video Play video from URL not working

Discussion in 'Audio & Video' started by feelmaster, Mar 15, 2020.

  1. feelmaster

    feelmaster

    Joined:
    Mar 13, 2018
    Posts:
    3
    Hello :)

    I am using vuforia and I am trying to play video on a plane with a image target. Everything works fine if I add local video but if I use URL it's not working.

    I tried using different services like dropbox and my own webpage to host the .mp4 and .webm so I have a correct link but can't make it work.

    If I try with this video it works perfect http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

    This is the video I am trying to add ->
    https://aleeadesign.com/wp-content/uploads/2020/03/MOP2020.webm

    I tried also with .mp4 version and couldn't make it work. Should the video have certain conditions ? Thank you :D :D
     
    charmseer likes this.
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    On most Unity platforms, there is a difference between how playback from http/https is done for mp4 and webm. mp4 typically does a progressive download, which means it plays while downloading. But on all platforms except Android and WebGL, webm playback from the network is done by first downloading the whole file locally. I've just tried with your webm url and it does play fine, but you have to wait for the download to be finished. This file is 227Mb and my download speed here is around 1Mb/s, so it'll be rouglhy 4 minutes before playback starts.

    So when playing large movies, unless you're playing on Android or WebGL, be prepared for a longer wait before start if you use webm, and try to use mp4 instead if at all possible. Does this match your observations, or is webm never working (even with small files)?

    Hope this helps! Also please let us know what was the problem was with mp4, as the problem described above should not apply here.

    Have a nice day,

    Dominique Leroux
    A/V developer at Unity
     
    charmseer likes this.
  3. feelmaster

    feelmaster

    Joined:
    Mar 13, 2018
    Posts:
    3
  4. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi again!

    I just tried this link both on Windows and OSX, and while the playback does start on both platforms, it eventually halts because the server isn't able to keep up. You can somewhat mitigate the situation on Windows by disabling the "Skip on Drop" setting in the VideoPlayer. This will stop the VideoPlayer from skipping ahead when it detects it cannot keep up with the movie timing. So you'll see all frames but possibly at a slower pace. However the playback may still halt if the server is too slow to respond.

    The mp4 you are using is 365 Mbytes and is 4 minutes 55 seconds long. This means about 1.2Mbytes/sec and is too much for the network capability. It took me around 10 minutes just to download it. I cannot say if the limit is imposed by aleeadesign.com, by sheer network congestion, or by my own ISP, but you get the idea.

    By comparison, the Big Buck Bunny link you have used for reference is 151 Mbytes for 9 minutes 56 seconds, which means 258 Kbytes/sec, and it plays fine on both OSX and Windows.

    So I would suggest experimenting with lower bitrate content if you want the streaming to be fluid under these network constraints. You can easily re-encode this content using ffmpeg, for example, and see what quality compromises need to be done to get to a better experience.

    Hope this helps!

    Dominique
     
    NCosoDev likes this.
  5. feelmaster

    feelmaster

    Joined:
    Mar 13, 2018
    Posts:
    3
    Perfect!! big thank you for your detailed explanation <3
     
  6. Mamoon178

    Mamoon178

    Joined:
    Jul 26, 2017
    Posts:
    36
    Hi everyone i am try to play video through url in webGL but video not play. in editor work fine but in webGL not play video. i use unity 2019.2.12
     
  7. Firewalker

    Firewalker

    Joined:
    Mar 30, 2012
    Posts:
    39
    You need to upgrade your Unity version
     
  8. essanel

    essanel

    Joined:
    Oct 6, 2020
    Posts:
    1
    Try to reinstall the app maybe? It might help in some situations, not every time though, but it's worth trying. If it's not working, the problem can be something else. My friend had a similar problem and he used to download the video from YouTube. He used to copy the link URL and insert it on ymp4.download, in this way he could download the video and watch it offline even in the plane. This can be a great solution if you have trouble playing it from an URL and the best thing is that you even don't need an internet connection to watch it.
     
    Last edited: Dec 15, 2020
  9. temoorwali

    temoorwali

    Joined:
    Feb 16, 2015
    Posts:
    3
    I tried unity 2019.4f1 but didnt worked then I upgraded to unity 2020.1.11f1 and it worked for me.
     
  10. NancyVeach

    NancyVeach

    Joined:
    Dec 8, 2020
    Posts:
    2
    if url is set via script VideoPlayer on WebGL does not play Video then try :

    To reproduce:
    1. Build and run attached project for on WebGL platform.

    Expected Result: video is played on the cube
    Actual Result: no video is played

    Reproducible: 5.6.0b5, 5.6.0b6

    Check if the video is playing. If video play in URL then it should work in WebGl too by following this. Otherwise there will only audio playing. For good video the audio plays an important role. To make your audio more clear and quality-full for your video, you must use microphones of high quality. But when recording sound for professional it us necessary to make sure your microphone working. Don't worry, you can carry a mic test online with no need to log in or downloading third party application. It will help you to check your microphone working before any project. This will ensures you that your mic is working asp er need or do you need to adjust some setting for best results.
     
    Last edited: Mar 1, 2021