Expose OpenCV stream

asked 2020-01-17 06:03:55 -0600

Hello, I want to build a simple pipeline where I receive the stream from a ffmpeg server and then expose that stream to other machines to access (in this case it will be a TV). I am capturing the ffmpeg stream using OpenCV, then I will run some processing on it and I would like to know what is the best approach to expose that output.

For example, in this script I am reading from port 5000 at localhost. How can I send the result stream to the port 5001?

import cv2
import numpy as np
import os
vcap = cv2.VideoCapture("udp://@0.0.0.0:5000", cv2.CAP_FFMPEG)
while(1):
    ret, frame = vcap.read()
    if ret == False:
        print("Frame is empty")
        break
    else:
        cv2.imshow('VIDEO', frame)
        cv2.waitKey(1)

Is there any work done on this topic?

Kind regards

edit retag flag offensive close merge delete

Comments

if you have gstreamer support builtin, you can build a server pipeline with cv2.VideoWriter

berak gravatar imageberak ( 2020-01-17 06:15:31 -0600 )edit