Decode the video frames in real time using gstreamer, modify them using opencv, and then write them back
Decode the video frames in real time using gstreamer, modify them using opencv, and then write them back import os import gi import numpy as np import cv2 gi.require_version(‘Gst’, ‘1.0’) gi.require_version(‘GLib’, ‘2.0’) gi.require_version(‘GstApp’, ‘1.0’) from gi.repository import Gst, GLib, GstApp os.environ[‘XDG_RUNTIME_DIR’] = ‘/tmp/runtime-dir’ os.environ[‘GST_DEBUG’] = ‘3,vaapih264enc:5,vaapih264dec:5’ Gst.init(None) class RTSPToMP4: def __init__(self, rtsp_url, output_file, duration): self.rtsp_url […]