Skip to content

Unity-Film-and-animation-industry/FfmpegWithOpenCVForUnityExample

 
 

Repository files navigation

Ffmpeg With OpenCVForUnity Example

FfmpegWithOpenCVForUnityExample

Overview

  • Integrate "FFmpeg for Unity" with "OpenCV for Unity".
  • Replace WebCamTextureToMatHelper with FfmpegToMatHelper.
  • FFmpeg receives video from various supported input sources (such as RTSP, HTTP, HLS, or local files), converts it to OpenCV’s Mat class, and performs image processing.

Environment

Setup

  1. Download the latest release unitypackage. FfmpegWithOpenCVForUnityExample.unitypackage
  2. Create a new project. (FfmpegWithOpenCVForUnityExample)
  3. Import and Setup OpenCV for Unity.
    • Download Dnn model files by ExampleAssetsDownloader. download_dnn_models.png
    • Move the files from the "OpenCVForUnity/StreamingAssets/" folder to the "Assets/StreamingAssets" folder. move_streamingassetsfolder.png
  4. Import and Setup FFmpeg for Unity.
  5. Import Runtime Inspector & Hierarchy.
  6. Import In-game Debug Console.
  7. Import FfmpegWithOpenCVForUnityExample.unitypackage.
  8. Set the URL of RTSPServer you wish to receive. ffmpeg_rtsp_settings.png
  9. Add the "Assets/FfmpegWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
  10. Build and Deploy. setup.png

ScreenShot

screenshot01.png screenshot02.png

About

Example of integrating "FFmpeg for Unity" with "OpenCV for Unity"

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 63.7%
  • Jupyter Notebook 36.3%