OpenCVForUnity icon indicating copy to clipboard operation
OpenCVForUnity copied to clipboard

VideoCapture fails on Android for HLS-URL

Open hellovertex opened this issue 3 years ago • 1 comments

Hi,

I am trying to process individual frames of a HLS video stream, similar to your VideoCapture Example. Using VideoCapture(...) to open the HLS URL works in Play Mode on my Windows 10 machine but after building and running on my Android Tablet, it does not work anymore, videoCapture.isOpened() returns false there.

Is it generally possible to play HLS Stream on Android Tablet using your Asset? Do you have an idea why it might fail with my setup?:

Device: Samsung Galaxy Tab Active Pro (Modell: SM-T545) Android: 11 Unity: 2021.3.9f1 LTS (tried with 2020 LTS same issue) OpenCVForUnity version = opencvforunity 2.4.8 (4.6.0-dev)

I tried solutions from

  1. https://forum.unity.com/threads/released-opencv-for-unity.277080/page-55#post-7427405 I copied opencv_videoio_ffmpeg460_64.dll to my project root directory

  2. https://github.com/EnoxSoftware/OpenCVForUnity/issues/99 and https://github.com/EnoxSoftware/OpenCVForUnity/issues/43 My relevant build settings are grafik and grafik

  3. In your Example it says 'Please move from “OpenCVForUnity/StreamingAssets/” to “Assets/StreamingAssets/” folder' I did that, my Assets/Streamingassets looks like this: grafik

Is this feature supported? The Stream URL comes from AWS Kinesis Video GetHLSStreamingSessionURL function, if that is relevant. Thanks in advance!

hellovertex avatar Sep 15 '22 15:09 hellovertex

Unfortunately, HLS video stream is not supported on the OpenCVForUnity Android platform. Perhaps you need to get the video frames in another asset and then convert them to OpenCVForUnity's Mat. https://github.com/EnoxSoftware/VideoPlayerWithOpenCVForUnityExample https://forum.unity.com/threads/unity-video-player-hls-support.581719/

EnoxSoftware avatar Sep 16 '22 16:09 EnoxSoftware