Efficient pipeline for streaming BGR frames to the local network via UDP
Ravi Joshi
ravi.joshi53 at yahoo.com
Wed Aug 21 17:38:38 UTC 2024
Hello,
First of all, thank you very much for allowing me to post here. I am receiving h264 frames of a stream (720x360 at 30fps) from a camera connected to my PC via USB. I am converting these frames to BGR frames supported in OpenCV. After the conversion, these frames are sent to the local network via UDP using GStreamer in C++. A code snippet is shown below:
---------------------------------------class VideoServer {public: VideoServer() { std::string pipeline = "appsrc ! video/x-raw,format=BGR ! queue ! videoconvert ! x264enc bitrate=5000 ! " "mpegtsmux alignment=7 ! rndbuffersize max=1316 min=1316 ! udpsink port=5005";
writer = std::make_unique<cv::VideoWriter>(pipeline, cv::CAP_GSTREAMER, 0, fps_, cv::Size(width_, height_)); } void VideoDataCallack(const uint8_t *data, size_t size, int64_t timestamp) override { std::cout << "At timestamp: " << timestamp << " video data of size " << size << " received." << std::endl; // convert h264_frame to opencv_frame writer->write(opencv_frame); }
private: std::unique_ptr<cv::VideoWriter> writer;};---------------------------------------
My goal is to steam these frames with minimal latency. Therefore, can someone point me to an efficient pipeline suitable for the above code snippet?
Thank you for your time and kind support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20240821/99ea4a1c/attachment.htm>
More information about the gstreamer-devel
mailing list