We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I have created a simple Gstreamer based backend (which in this case I used with v4l2src), in case you want to add that to the repo
import os import gi gi.require_version('Gst', '1.0') from gi.repository import Gst from base_camera import BaseCamera Gst.init(None) class Camera(BaseCamera): video_device = "/dev/video0" @staticmethod def set_video_device(device): Camera.video_device = device def __init__(self): if os.environ.get('GST_CAMERA_VIDEO_DEVICE'): Camera.set_video_device(int(os.environ['GST_CAMERA_VIDEO_DEVICE'])) super(Camera, self).__init__() @staticmethod def frames(): MJPEG_PIPELINE = f"v4l2src device={Camera.video_device} ! jpegenc ! appsink name=sink" pipeline = Gst.parse_launch(MJPEG_PIPELINE) sink = pipeline.get_by_name("sink") # Start playing ret = pipeline.set_state(Gst.State.PLAYING) if ret == Gst.StateChangeReturn.FAILURE: print("Unable to set the pipeline to the playing state.") exit(-1) try: while True: sample = sink.emit("pull-sample") buf = sample.get_buffer() #print("Timestamp: ", buf.pts) yield buf.extract_dup(0, buf.get_size()) finally: pipeline.set_state(Gst.State.NULL)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, I have created a simple Gstreamer based backend (which in this case I used with v4l2src), in case you want to add that to the repo
The text was updated successfully, but these errors were encountered: