Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e7b8c0b
timelapse sample
AdityaKBhadragond14 May 8, 2024
0b02ac2
timelaspe file changes
AdityaKBhadragond14 May 8, 2024
55235e4
wip sample
nsabale7 May 10, 2024
c116aad
samples WIP.
AdityaKBhadragond14 May 13, 2024
213bf2c
added main to sample cpp file.
AdityaKBhadragond14 May 14, 2024
5cb1025
removed sample test file from tests.
AdityaKBhadragond14 May 14, 2024
9c70041
added sample example to create thumbnail from mp4 video
SatwikSShanbhag May 14, 2024
2f3adb6
Improved motion vector data code.
AdityaKBhadragond14 May 14, 2024
738763b
reduced thread sleep seconds
SatwikSShanbhag May 15, 2024
5315e62
using absolute path.
AdityaKBhadragond14 May 15, 2024
b89e3a6
Reverting unwanted changes.
AdityaKBhadragond14 May 15, 2024
ab3f182
added new sample which will start video from beginning using flushAll…
SatwikSShanbhag May 17, 2024
f1d8cc0
refactored CMake list and renamed files
SatwikSShanbhag May 17, 2024
da51b44
using resolved time stamp when seeking
SatwikSShanbhag May 20, 2024
ad28405
Merge branch 'ab/timelapse_sample' into ss/sample_example
SatwikSShanbhag May 20, 2024
ad0752f
Fixed the ghost channel issue in MotionVectorExtractor.
AdityaKBhadragond14 May 20, 2024
005cd59
revert vcpkg.
AdityaKBhadragond14 May 20, 2024
e9ccde5
changes.
AdityaKBhadragond14 May 21, 2024
a5df32a
taking video paths from terminal and modified cmake.
AdityaKBhadragond14 May 23, 2024
cce5ba2
vcpkg baseline revert.
AdityaKBhadragond14 May 23, 2024
87c26d2
reset vcpkg head.
AdityaKBhadragond14 May 23, 2024
4627b36
vcpkg revert
AdityaKBhadragond14 May 23, 2024
31d8bf5
vcpkg revert.
AdityaKBhadragond14 May 23, 2024
518a75e
update submodule
AdityaKBhadragond14 May 23, 2024
b45c423
update vcpkg final
AdityaKBhadragond14 May 23, 2024
95bdf12
Merge branch 'Apra-Labs:main' into ab/timelapse_sample
AdityaKBhadragond14 May 23, 2024
e0f0e91
Corrected cmake for samples.
AdityaKBhadragond14 May 23, 2024
dc1c0a6
Corrected base cmake for samples.
AdityaKBhadragond14 May 23, 2024
29287b1
Running pipeline for face detection
nsabale7 May 27, 2024
82e72bc
Merge branch 'ab/timelapse_sample' into ss/sample_example
SatwikSShanbhag May 27, 2024
7935533
added test thumbnail sample
SatwikSShanbhag May 27, 2024
cc20269
wip as per the structure
nsabale7 May 27, 2024
c38f63f
test for play mp4 from beginning
SatwikSShanbhag May 27, 2024
41ff3ae
updated main CMake
SatwikSShanbhag May 27, 2024
02fc588
1. Fixed the props for Mp4ReaderSource and Mp4WriterSink
AdityaKBhadragond14 May 27, 2024
744d40d
refactored test and CMake file
SatwikSShanbhag May 27, 2024
574fc11
Corrected cmake and test for timelapse sample.
AdityaKBhadragond14 May 28, 2024
773a376
1. Removed the sendOverlayFrames prop to remove overlay frames, inste…
AdityaKBhadragond14 May 30, 2024
3c26a39
Algo to remove noisy black frames.
AdityaKBhadragond14 Jun 3, 2024
6dae9cd
files format.
AdityaKBhadragond14 Jun 3, 2024
f499d5f
refactored CMake and file structure for thumbnail samples
SatwikSShanbhag Jun 3, 2024
53a3c59
refactored CMake and file structure for play mp4 from beginning sample
SatwikSShanbhag Jun 3, 2024
b26a871
base CMake changes
SatwikSShanbhag Jun 3, 2024
48f2556
Merge branch 'ab/timelapse_sample' into ss/sample_example
SatwikSShanbhag Jun 3, 2024
f07bc4e
Addressed comments.
AdityaKBhadragond14 Jun 5, 2024
a2102f1
changes in cmake
nsabale7 Jun 14, 2024
06f679e
Added readme file for samples. code refactoring and renaming. Address…
AdityaKBhadragond14 Jun 17, 2024
133d93b
removed not required libs and file formatting.
AdityaKBhadragond14 Jun 18, 2024
5888659
Merge branch 'ab/timelapse_sample' into ss/sample_example
SatwikSShanbhag Jun 18, 2024
fab05b3
restored files
SatwikSShanbhag Jun 24, 2024
d920279
Merge branch 'main' into ab/timelapse_sample
AdityaKBhadragond14 Jul 2, 2024
7478f05
Merge branch 'ab/timelapse_sample' into ss/sample_example
SatwikSShanbhag Jul 4, 2024
7f79097
Merge pull request #2 from SatwikSShanbhag/ss/sample_example
AdityaKBhadragond14 Jul 4, 2024
1c2fa9d
Merge branch 'ab/timelapse_sample' into ns/samples_timelapse
AdityaKBhadragond14 Jul 9, 2024
064cce5
changes in constructor
nsabale7 Jul 9, 2024
197b75d
Merge branch 'ns/samples_timelapse' of https://github.com/nsabale7/Ap…
nsabale7 Jul 9, 2024
1031260
Merge pull request #3 from nsabale7/ns/samples_timelapse
AdityaKBhadragond14 Jul 9, 2024
8cbb00b
relay sample.
AdityaKBhadragond14 Jul 9, 2024
61690e5
base cmake changes.
AdityaKBhadragond14 Jul 9, 2024
5903117
Corrected linking libraries in timelapse sample cmake.
AdityaKBhadragond14 Jul 16, 2024
17a8fd1
Merge branch 'main' into ab/timelapse_sample
joiskash Jul 24, 2024
2b046f6
rename.
AdityaKBhadragond14 Jul 24, 2024
6ab76c7
Set VPCPK PLATFORM TOOLSET to v143 to avoid issues related to v144.
joiskash May 20, 2025
14a4805
Merge branch 'main' of https://github.com/Apra-Labs/ApraPipes
joiskash Jun 16, 2025
be424a1
wip sample
joiskash May 10, 2024
73f9fed
Merge branch 'ab/timelapse_sample' of https://github.com/AdityaKBhadr…
joiskash Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 164 additions & 1 deletion base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ IF(ENABLE_LINUX)
ENDIF(ENABLE_LINUX)

IF(ENABLE_WINDOWS)
set(VCPKG_PLATFORM_TOOLSET v143)
add_compile_definitions(WINDOWS)
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "x64-windows")
set(VCPKG_PLATFORM_TOOLSET "v143" CACHE STRING "v143" FORCE)
Expand Down Expand Up @@ -199,6 +200,13 @@ SET(CORE_FILES
src/SimpleControlModule.cpp
src/APErrorObject.cpp
src/APHealthObject.cpp
.././samples/face_detection_cpu/face_detection_cpu.cpp
.././samples/create_thumbnail_from_mp4_video/generate_thumbnail_from_mp4_video.cpp
.././samples/timelapse-sample/timelapse_summary.h
.././samples/timelapse-sample/timelapse_summary.cpp
.././samples/relay-sample/relay_sample.cpp
.././samples/relay-sample/relay_sample.cpp
.././samples/timelapse-sample/timelapse_summary.h
)

SET(CORE_FILES_H
Expand Down Expand Up @@ -260,11 +268,17 @@ SET(CORE_FILES_H
include/OverlayModule.h
include/OrderedCacheOfFiles.h
include/TestSignalGeneratorSrc.h
.././samples/timelapse-sample/timelapse_summary.cpp
include/AbsControlModule.h
include/SimpleControlModule.h
include/APErrorObject.h
include/APCallback.h
include/APHealthObject.h
.././samples/face_detection_cpu/face_detection_cpu.h
.././samples/create_thumbnail_from_mp4_video/GenerateThumbnailsPipeline.h
.././samples/timelapse-sample/timelapse_summary.h
.././samples/relay-sample/relay_sample.h
.././samples/relay-sample/relay_sample.h
)

IF(ENABLE_WINDOWS)
Expand Down Expand Up @@ -525,7 +539,6 @@ target_include_directories ( aprapipes PRIVATE
${NVCODEC_INCLUDE_DIR}
)


# aprapipes Unit Tests

IF (ENABLE_ARM64)
Expand Down Expand Up @@ -573,6 +586,35 @@ IF (ENABLE_CUDA)
ENDIF(NOT ENABLE_ARM64)
ENDIF(ENABLE_CUDA)

SET(SAMPLE_UT_FILES
test/utmain.cpp
test/test_utils.cpp
test/test_utils.h
.././samples/timelapse-sample/timelapse_summary_test.cpp
.././samples/create_thumbnail_from_mp4_video/test_generate_thumbnail_from_mp4_video.cpp
.././samples/face_detection_cpu/test_face_detection_cpu.cpp
.././samples/play_mp4_from_beginning/test_play_mp4_video_from_beginning.cpp
.././samples/relay-sample/relay_sample_test.cpp
)

SET(SAMPLE_CORE_FILES
.././samples/timelapse-sample/timelapse_summary.h
.././samples/timelapse-sample/timelapse_summary.cpp
.././samples/create_thumbnail_from_mp4_video/GenerateThumbnailsPipeline.cpp
.././samples/create_thumbnail_from_mp4_video/GenerateThumbnailsPipeline.h
.././samples/face_detection_cpu/face_detection_cpu.h
.././samples/face_detection_cpu/face_detection_cpu.cpp
.././samples/play_mp4_from_beginning/PlayMp4VideoFromBeginning.h
.././samples/play_mp4_from_beginning/PlayMp4VideoFromBeginning.cpp
.././samples/relay-sample/relay_sample.h
.././samples/relay-sample/relay_sample.cpp
)

SET(SAMPLE_SOURCE
${SAMPLE_CORE_FILES}
${SAMPLE_UT_FILES}
)

SET(UT_FILES
test/utmain.cpp
test/unit_tests.cpp
Expand Down Expand Up @@ -629,10 +671,32 @@ SET(UT_FILES
test/testSignalGeneratorSrc_tests.cpp
test/audioToTextXform_tests.cpp
test/simpleControlModuleTests.cpp
test/timelapse.cpp
${ARM64_UT_FILES}
${CUDA_UT_FILES}
)

SET(SAMPLE_UT_FILES
test/utmain.cpp
test/test_utils.cpp
test/test_utils.h
../samples/face_detection_cpu/test_face_detection_cpu.cpp
../samples/relay-sample/relay_sample_test.cpp
.././samples/timelapse-sample/timelapse_summary_test.cpp
)

SET(SAMPLE_CORE_FILES
../samples/relay-sample/relay_sample.cpp
../samples/create_thumbnail_from_mp4_video/GenerateThumbnailsPipeline.cpp
../samples/play_mp4_from_beginning/PlayMp4VideoFromBeginning.cpp
../samples/face_detection_cpu/face_detection_cpu.cpp
../samples/timelapse-sample/timelapse_summary.cpp)

SET(SAMPLE_SOURCE
${SAMPLE_CORE_FILES}
${SAMPLE_UT_FILES}
)

IF(ENABLE_LINUX)
list(APPEND UT_FILES
test/gtkglrenderer_tests.cpp
Expand All @@ -646,6 +710,43 @@ IF(ENABLE_LINUX)
ENDIF(ENABLE_LINUX)

add_executable(aprapipesut ${UT_FILES})
add_executable(aprapipessampleut ${SAMPLE_SOURCE})

target_include_directories ( aprapipessampleut PRIVATE
${JETSON_MULTIMEDIA_LIB_INCLUDE}
${FFMPEG_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${LIBMP4_INC_DIR}
${BARESIP_INC_DIR}
${LIBRE_INC_DIR}
${NVCODEC_INCLUDE_DIR}
test
)

IF(ENABLE_ARM64)
target_include_directories(aprapipesut PRIVATE ${VCPKG_GTK_INCLUDE_DIRS})
ENDIF(ENABLE_ARM64)

IF(ENABLE_LINUX)
target_include_directories(aprapipesut PRIVATE ${GTK3_INCLUDE_DIRS})
target_link_libraries(aprapipesut
${GDK3_LIBRARIES}
${GTK3_LIBRARIES}
)
ENDIF(ENABLE_LINUX)

target_include_directories ( aprapipessampleut PRIVATE
${JETSON_MULTIMEDIA_LIB_INCLUDE}
${FFMPEG_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${LIBMP4_INC_DIR}
${BARESIP_INC_DIR}
${LIBRE_INC_DIR}
${NVCODEC_INCLUDE_DIR}
test
)

IF(ENABLE_ARM64)
target_include_directories ( aprapipesut PRIVATE ${JETSON_MULTIMEDIA_LIB_INCLUDE} ${FFMPEG_ROOT} ${JPEG_INCLUDE_DIR})
Expand All @@ -658,6 +759,8 @@ ENDIF (ENABLE_CUDA)
find_library(OPENH264_LIB NAMES openh264.lib libopenh264.a REQUIRED)
find_library(LIBMP4_LIB NAMES mp4lib.lib libmp4lib.a REQUIRED)



IF(ENABLE_ARM64)
target_include_directories(aprapipesut PRIVATE ${VCPKG_GTK_INCLUDE_DIRS})
ENDIF(ENABLE_ARM64)
Expand All @@ -670,6 +773,41 @@ IF(ENABLE_LINUX)
)
ENDIF(ENABLE_LINUX)

target_include_directories ( aprapipessampleut PRIVATE
${JETSON_MULTIMEDIA_LIB_INCLUDE}
${FFMPEG_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${LIBMP4_INC_DIR}
${BARESIP_INC_DIR}
${LIBRE_INC_DIR}
${NVCODEC_INCLUDE_DIR}
test
)

target_link_libraries(aprapipessampleut
aprapipes
${JPEG_LIBRARIES}
${LIBMP4_LIB}
${OPENH264_LIB}
${Boost_LIBRARIES}
${FFMPEG_LIBRARIES}
${OpenCV_LIBRARIES}
${JETSON_LIBS}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need all libs in the aprapipessampleut ? I dont think so.

${NVCUDAToolkit_LIBS}
${NVCODEC_LIB}
${NVJPEGLIB_L4T}
${CURSES_LIBRARIES}
ZXing::Core
ZXing::ZXing
BZip2::BZip2
ZLIB::ZLIB
LibLZMA::LibLZMA
bigint::bigint
sfml-audio
whisper::whisper
)

target_link_libraries(aprapipesut
aprapipes
${GLEW_LIBRARIES}
Expand All @@ -679,6 +817,28 @@ target_link_libraries(aprapipesut
${Boost_LIBRARIES}
${FFMPEG_LIBRARIES}
${OpenCV_LIBRARIES}
${NVCUDAToolkit_LIBS}
${NVCODEC_LIB}
${NVJPEGLIB_L4T}
${CURSES_LIBRARIES}
ZXing::Core
ZXing::ZXing
BZip2::BZip2
ZLIB::ZLIB
LibLZMA::LibLZMA
bigint::bigint
sfml-audio
whisper::whisper
)

target_link_libraries(aprapipesut
aprapipes
${JPEG_LIBRARIES}
${LIBMP4_LIB}
${OPENH264_LIB}
${Boost_LIBRARIES}
${FFMPEG_LIBRARIES}
${OpenCV_LIBRARIES}
${JETSON_LIBS}
${NVCUDAToolkit_LIBS}
${NVCODEC_LIB}
Expand All @@ -702,6 +862,7 @@ IF(ENABLE_WINDOWS)
ENDIF(GHA)
ENDIF(ENABLE_WINDOWS)


include(GNUInstallDirs)

# BUILD_INTERFACE specifies where to find includes during build time
Expand Down Expand Up @@ -736,3 +897,5 @@ install(

install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aprapipes)

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../samples ${CMAKE_CURRENT_BINARY_DIR}/samples)
5 changes: 4 additions & 1 deletion base/include/FaceDetectorXform.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
class FaceDetectorXformProps : public ModuleProps
{
public:
FaceDetectorXformProps(double _scaleFactor = 1.0, float _confidenceThreshold = 0.5) : scaleFactor(_scaleFactor), confidenceThreshold(_confidenceThreshold)
FaceDetectorXformProps(double _scaleFactor = 1.0, float _confidenceThreshold = 0.5, std::string _Face_Detection_Configuration= "./data/assets/deploy.prototxt", std::string _Face_Detection_Weights= "./data/assets/res10_300x300_ssd_iter_140000_fp16.caffemodel")
: scaleFactor(_scaleFactor), confidenceThreshold(_confidenceThreshold), FACE_DETECTION_CONFIGURATION(_Face_Detection_Configuration), FACE_DETECTION_WEIGHTS(_Face_Detection_Weights)
{
}
double scaleFactor;
float confidenceThreshold;
std::string FACE_DETECTION_CONFIGURATION;
std::string FACE_DETECTION_WEIGHTS;

size_t getSerializeSize()
{
Expand Down
1 change: 1 addition & 0 deletions base/include/FacialLandmarksCV.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ class FacialLandmarkCV : public Module
FacialLandmarkCVProps mProp;
bool handlePropsChange(frame_sp& frame);
std::string mOutputPinId1;
std::string rawFramePinId;
};
28 changes: 13 additions & 15 deletions base/include/MotionVectorExtractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ class MvExtractDetailAbs;
class DetailFfmpeg;
class DetailOpenH264;

class MotionVectorExtractorProps : public ModuleProps
{
class MotionVectorExtractorProps : public ModuleProps {
public:
enum MVExtractMethod
{
FFMPEG,
OPENH264
};
enum MVExtractMethod { FFMPEG, OPENH264 };

MotionVectorExtractorProps(MVExtractMethod _MVExtractMethod = MVExtractMethod::FFMPEG, bool _sendDecodedFrame = false, int _motionVectorThreshold = 2) : MVExtract(_MVExtractMethod), sendDecodedFrame(_sendDecodedFrame), motionVectorThreshold(_motionVectorThreshold)
{
}
MotionVectorExtractorProps(
MVExtractMethod _MVExtractMethod = MVExtractMethod::FFMPEG,
bool _sendDecodedFrame = false, int _motionVectorThreshold = 2)
: MVExtract(_MVExtractMethod), sendDecodedFrame(_sendDecodedFrame),
motionVectorThreshold(_motionVectorThreshold) {}

size_t getSerializeSize()
{
Expand All @@ -26,26 +23,26 @@ class MotionVectorExtractorProps : public ModuleProps
bool sendDecodedFrame = false;
int motionVectorThreshold;
MVExtractMethod MVExtract = MVExtractMethod::FFMPEG;

private:
friend class boost::serialization::access;

template <class Archive>
void serialize(Archive& ar, const unsigned int version)
{
void serialize(Archive& ar, const unsigned int version) {
ar& boost::serialization::base_object<ModuleProps>(*this);
ar& sendDecodedFrame;
ar& motionVectorThreshold;
}
};

class MotionVectorExtractor : public Module
{
class MotionVectorExtractor : public Module {
public:
MotionVectorExtractor(MotionVectorExtractorProps _props);
virtual ~MotionVectorExtractor() {};
bool init();
bool term();
void setProps(MotionVectorExtractorProps& props);

protected:
bool process(frame_container& frame);
bool validateInputPins();
Expand All @@ -54,8 +51,9 @@ class MotionVectorExtractor : public Module
bool processSOS(frame_sp& frame);
void setMetadata(frame_sp metadata);
bool handlePropsChange(frame_sp& frame);

private:
boost::shared_ptr<MvExtractDetailAbs> mDetail;
framemetadata_sp rawOutputMetadata;
bool mShouldTriggerSOS = true;
};
};
Loading