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 What is the preferred video byte stream format for the Video object in 5.6?

Discussion in 'Audio & Video' started by peteforde, May 23, 2017.

  1. peteforde

    peteforde

    Joined:
    Apr 1, 2016
    Posts:
    20
    I am attempting to use the new Video Player component in 5.6 to play a live video stream that is currently an H264 flv presented as an mp4 that is served as a HLS feed via my nginx instance.

    I have verified the URL by opening the stream in VLC, but I still get an error about Unity not being able to read the byte stream format.

    For anyone curious, I use ffmpeg to pull the live stream from my 360 camera and then push it into nginx as an RTMP stream. I then use nginx-rtmp-module to serve the HLS feed:

    ffmpeg -loglevel error -i rtsp://192.168.0.173:8557/PSIA/Streaming/channels/2?videoCodecType=H.264 -an -c:v libx264 -preset:v superfast -s 2048x1024 -g 25 -f flv rtmp://192.168.0.17:1935/hls/360cam

    It looks intimidating, but basically that translates to "take this stream, do some stuff to it, send it out this way" which lines up to my desired end goal. ffmpeg demands some patience as you will find conflicting tutorials and new ways vs old ways to do things, but if you go in expecting to experiment you can do just about anything and not have to pay for Wowza.
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,352
    Did you had any luck with this?

    At least using EasyMovieTexture, can play that HLS stream with EasyMovieTexture plugin,
    but now looking for how to play using RTSP to have less lag..(that plugin only supports rtsp on android)