Use AMB82-Mini as a ai powered usb webcam using the USB OTG

I want to use the AMB82-Mini with further functionality developed in a more powerful debian board (RPi / NanoPi / OrangePi, etc…). I need to access the H264 stream on these boards via USB or any other wired connection, after being processed for object detection and motion detection with the bounding boxes. How can I achieve this? The USB OTG functionality is not documented in Arduino docs. I am open to other suggestions too.

Hi @Vignan_Tej,

This feature is still not available yet.

To use AMB82-Mini as an ai powered usb webcam, this feature will have to be ported. You may raise this as a feature request in our Github repo.

Thank you.

Hi @Vignan_Tej,

The Arduino SDK prerelease version (4.0.8-build20240805) now supports USB UVC feature.

As it is a prerelease version (dev), the SDK could be unstable. Do let us know if you have encounter any issues.

To use the Arduino SDK prerelease version (4.0.8-build20240805), kindly input https://github.com/ambiot/ambpro2_arduino/raw/dev/Arduino_package/package_realtek_amebapro2_early_index.json under preference in Arduino IDE and install 4.0.8-build20240805.

2 Likes

Thanks for the reply. Trying out the prerelease version.

Hi Team,

Do we have an example code for the USB UVC with face recognition?

Hi @Vignan_Tej ,

We do not have this example, however you may refer the following guide to implement it.

USB UVC: USB – UVC Device – Realtek IoT/Wi-Fi MCU Solutions
Face recognition: Neural Nework – Face Recognition – Realtek IoT/Wi-Fi MCU Solutions
API documentation:
Class UVCD – Realtek IoT/Wi-Fi MCU Solutions
FaceDetectionRecognition Class – Realtek IoT/Wi-Fi MCU Solutions

Hi Pammy,

Thanks for the directions. I am not able to get any output from the USB UVC Example.

This is the console log output. I Have not made any changes to the example.

14:56:28.535 -> set_alt interface 0 alt =0

14:56:28.535 -> 
set_alt interface 1 alt =0

14:56:28.535 -> 
set_alt interface 1 alt =0

14:56:28.535 -> 
set_alt interface 1 alt =0

14:56:28.541 -> 
fun_suspend

14:56:34.102 -> streaming request (req 81 cs 01)

14:56:34.102 -> 
probe

14:56:34.102 -> streaming request (req 01 cs 01)

14:56:34.102 -> 
setting commit control, length = 26

14:56:34.102 -> 
format ->7014edac

14:56:34.134 -> 
interval[0] = 416666

14:56:34.134 -> 
format = 1 w = 1920 h = 1080 fps = 416666

14:56:34.134 -> 
streaming request (req 81 cs 01)

14:56:34.134 -> 
probe

14:56:34.134 -> streaming request (req 83 cs 01)

14:56:34.134 -> 
format ->7014eda4 ->7014eda4

14:56:34.134 -> 
Type_ = 0

14:56:34.134 -> 
format ->7014eda4 ->7014eda4 size 4147200

Hi @Vignan_Tej ,

May I know which media player you are using? I suggest that you can use PotPlayer.

If you using PotPlayer, please use the following setting to start stream.

1 Like

I was using windows default camera application. It was being recognised as USB UVS Class, but black screen and the stream did not start.
I am planning to get the stream through go2rtc to stream it over webrtc.

Currently we have not test on windows default camera application yet. there are chances that the example is not supported for windows default camera application yet.

There are also some updates for usb uvc, Update USB UVCD APIs and CI workflow · ambiot/ambpro2_arduino@509c46a · GitHub
You may need to modify the following in Arduino SDK to get more format type supported.

  • cores/ambpro2/video_drv.c
  • cores/ambpro2/video_drv.c
  • src/UVCD.cpp
  • src/UVCD.h
1 Like

Does it have Controls in camera UI when using it as usb-cam ?

I studied from the video presentation that brightness, contrast, exposure and gray mode can be set from the IDE but will the Camera app UI pick it up and can we be able to manually set it from UI instead of IDE command?

Regards,

Hi @spikerguy

which camera UI are you referring to? If you are creating your own UI, you can refer to VideoStream Class – Realtek IoT/Wi-Fi MCU Solutions to develop and program your UI. We does not provide UI; it can only be set manually from the IDE.

1 Like

Hi @pammyleong, I am not able to get the video stream using ffmpeg. Any specific configuration I should use? I tried this.

sudo ffmpeg -f v4l2 -video_size 1920x1080 -i /dev/video0 -vcodec libx264 -preset veryfast -crf 23 output.mp4

This is the output I got:


Even the copying the stream directly didn’t work…

Hi Pammy,

Any update on connecting via ffmpeg? It would be great if it’s available.

Regards,
Vignan Tej :checkered_flag:

Hi @pammyleong,
Any update on using the AMB82-Mini UVC via ffmpeg?

I thinks there is no UI for ffmpeg currently.

I am not looking for a UI. If I can get ffmpeg to record video to file. I can develop my application accordingly.

Regards,
Vignan Tej