FfmpegWithOpenCVForUnityExample icon indicating copy to clipboard operation
FfmpegWithOpenCVForUnityExample copied to clipboard

FFmpeg

Open axmllop opened this issue 6 months ago • 15 comments

Why is there no FFmpegUnity folder in Unity? I get an error after importing!Error:Assets\FfmpegWithOpenCVForUnityExample\FfmpegAsyncGPUReadback2MatHelperExample\FfmpegAsyncGPUReadback2MatHelperExample.cs(5,22): error CS0234: The type or namespace name 'UnityIntegration' does not exist in the namespace 'OpenCVForUnity' (are you missing an assembly reference?) This is just one of the errors, there are many similar errors like this.

Please provide an answer. Thank you.

axmllop avatar Aug 21 '25 06:08 axmllop

The FfmpegUnity asset is required for this Example project. Please obtain FfmpegUnity and import it into the project. https://github.com/MUMEI-NON906/FfmpegUnityDocs https://github.com/MUMEI-NON906/FfmpegUnity

EnoxSoftware avatar Aug 21 '25 07:08 EnoxSoftware

I have found ffmpegUnity and imported it into Unity, I opened the FfmpegGetTexturePerframeToMatHelperExample scene, and configured the parameters the same as your example, only the Rtsp address is different, but after running the program, it shows a timeout. ·

axmllop avatar Aug 21 '25 08:08 axmllop

Unfortunately, the current code does not seem to work properly with FfmpegToMatHelperExample, FfplayToMatHelperExample, and FfmpegGetTexturePerFrameToMatHelperExample when using rtsp or http addresses. The cause is currently under investigation.

FfmpegAsyncGPUReadback2MatHelperExample can read rtsp addresses with the following settings.

Image

EnoxSoftware avatar Aug 21 '25 21:08 EnoxSoftware

There is no ffmpegasyncgpureadback2mathelper scene in my scene, and there is no related script configuration like yours. Is it new? Or is there something wrong with my version of FfmpegUnity?

If I use the FfplayStream scene in FfmpegUnity, the address of the accessory RTSP can work normally, but it just doesn't work with opencv.

If you can work with opencv, please share it with me. Thank you very much! !

axmllop avatar Aug 22 '25 01:08 axmllop

Are you using the latest version (1.0.4) of FfmpegWithOpenCVForUnityExample? FfmpegAsyncGPUReadback2MatHelperExample was added in version 1.0.4.

OpenCV for Unity 3.0.0+ FFmpeg for Unity 2.11.1+ FfmpegWithOpenCVForUnityExample 1.0.4

EnoxSoftware avatar Aug 22 '25 08:08 EnoxSoftware

FFmpeg for Unity 2.10 This version

axmllop avatar Aug 22 '25 08:08 axmllop

Or do you have your own version? Can I get it? I can pay.

axmllop avatar Aug 22 '25 08:08 axmllop

Image Image

axmllop avatar Aug 22 '25 08:08 axmllop

FFmpeg for Unity 2.11.1 can access the repository by becoming a NON906 sponsor. https://github.com/sponsors/NON906 https://github.com/MUMEI-NON906/FfmpegUnity

However, I think FfmpegWithOpenCVForUnityExample 1.0.4 will work with FFmpeg for Unity 2.10.

EnoxSoftware avatar Aug 22 '25 09:08 EnoxSoftware

I re-created the project and can get the picture through RTSP, but at present, can't I cooperate with opencv to complete the identification of the specified picture?

axmllop avatar Aug 22 '25 10:08 axmllop

ObjectDetectionYOLOXExample and HumanSegmentationPPHumanSegExample will also work fine if you configure them as shown below. https://github.com/EnoxSoftware/FfmpegWithOpenCVForUnityExample/issues/2#issuecomment-3212128327

EnoxSoftware avatar Aug 22 '25 10:08 EnoxSoftware

Image How do I get the callback functions of various categories in the screen, such as person, whether the person callback is detected or not, and so on?

axmllop avatar Aug 25 '25 02:08 axmllop

Image Is the callback function of these tags, because I have to deal with some logic.

axmllop avatar Aug 25 '25 02:08 axmllop

It is possible to detect only persons by using a method that extracts only the results with a class ID of 0, which is the class ID for persons, from the detection results of YOLOXObjectDetector.

Download ObjectDetectionYOLOXExample.zip and import ObjectDetectionYOLOXExample.unitypackage. Use the added FilterByClassId method to filter detection data by specific class ID. ObjectDetectionYOLOXExample.zip

EnoxSoftware avatar Aug 25 '25 19:08 EnoxSoftware

Thank you very much for your answer. I successfully solved the human detection function yesterday. Thank you again.

axmllop avatar Aug 26 '25 05:08 axmllop