This repository contains native C/C++ VA SDK, Java helper library, and a Motion-Track example module. With this SDK, you can build your own VA modules for AndroVideo camera devices.
The AVC native C/C++ VA SDK contains code that facilitate building video analytics modules for AndroVideo camera devices.
- Native VA SDK Template (An Empty template for a video analytics module)
- Native VA MotionTrack Sample (An example with motion-track video analytics sample code)
- Native VA Tensorflow Object Detection Sample (An example with Google tensorflow model ssd_mobilenet_v1_coco)
- Download the Android NDK package (Recommend to download the latest stable version - r16b)
- Download the Native VA MotionTrack Sample
- Setup PATH env
$ export PATH=$PATH:YOUR_NDK_PATH
- Go into the working directory and Run ndk-build command
$ ndk-build
#You will find libva_motion_sample.so in libs/armeabi-v7a
- Connect camera device via adb
$ adb connect 192.168.0.10
$ adb devices
List of devices attached
192.168.0.10:5555 device
- Remount system before installing the VA module
$ adb remount
- Push VA module to device
$ adb push libs/armeabi-v7a/libva_motion_sample.so /vendor/lib/libva_motion_sample.so
- Update new VA config file
$ adb push va_config.txt /data/misc/media/va_config.txt
# Set va config path once
$ adb shell setprop persist.va.config /data/misc/media/va_config.txt
# Reboot device to enable new setting
$ adb reboot
- After rebooting, you can see your VA lib is loaded via logcat log
$ adb logcat
D/VABroker( 425 ): int32_t qipcam::VABroker::init(): VAEngines[2].libName = /vendor/lib/libva_motion_sample.so
D/VABroker( 425 ): int32_t qipcam::VABroker::init(): module_api_version = 0x1001
The AVC Java help library helps you to build Android applications that can enable/disable your own VA modules and receive your own VA events for further processing.
- Prepare an Android App development environment (https://developer.android.com)
- Download the Android Sample App
- Build and install the App to device
- You can see your VA module is enable via logcat log
$ adb logcat
I/AVCLog.IpcamBroadcastRecv( 2418 ): onReceive com.androvideo.va.action.USER_CONFIG
D/AVCIPCam( 2418 ): int32_t qipcam::AVCIPCamService::enableVA(android::String8, int): Enter MotionSample 1
I/va_motion_sample( 423 ): int32_t motiontrack_init(void**):
I/va_motion_sample( 423 ): int32_t motiontrack_get_supported_events(void*, int32_t*, int32_t*):