Source Nodes
Node đầu vào — đưa frame vào pipeline.
| Node | Header | Mô tả |
|---|---|---|
cvedix_file_src_node | nodes/src/cvedix_file_src_node.h | Đọc file video (MP4, AVI, MKV) |
cvedix_rtsp_src_node | nodes/src/cvedix_rtsp_src_node.h | Camera RTSP |
cvedix_rtmp_src_node | nodes/src/cvedix_rtmp_src_node.h | Stream RTMP |
cvedix_udp_src_node | nodes/src/cvedix_udp_src_node.h | Stream UDP H.264/H.265 |
cvedix_image_src_node | nodes/src/cvedix_image_src_node.h | File ảnh hoặc thư mục ảnh |
cvedix_app_src_node | nodes/src/cvedix_app_src_node.h | Ứng dụng tự đẩy frame (cv::Mat) vào |
File Source
cpp
auto src = std::make_shared<cvedix_nodes::cvedix_file_src_node>(
"src", // tên node
0, // channel index
"video.mp4", // đường dẫn file
0.5, // resize ratio (0.5 = giảm nửa resolution)
true, // cycle (lặp lại video)
"avdec_h264", // decoder GStreamer
0 // skip_interval (0 = mọi frame)
);Giảm tải pipeline từ nguồn
resize ratio < 1.0giảm resolution ngay từ đầu — mọi node phía sau nhẹ hơn.skip_interval = 2chỉ xử lý 1/3 số frame — phù hợp analytics không cần mọi frame.
RTSP Source
cpp
auto src = std::make_shared<cvedix_nodes::cvedix_rtsp_src_node>(
"cam1",
0, // channel index
"rtsp://user:pass@192.168.1.10/stream1", // URL
0.5); // resize ratioNhiều camera → tạo nhiều node với channel_index khác nhau, có thể attach chung vào một detector (pattern N-1-N).
App Source (đẩy frame từ code)
cpp
auto src = std::make_shared<cvedix_nodes::cvedix_app_src_node>("app_src", 0);
// Trong vòng lặp của bạn:
cv::Mat frame = my_capture();
src->push_frame(frame);Dùng khi frame đến từ nguồn tùy biến (SDK camera riêng, decoder riêng, ảnh đã tiền xử lý).