Last active
March 14, 2025 04:12
-
-
Save usptact/6514e734c78e0b879ddfe50012e48341 to your computer and use it in GitHub Desktop.
GStreamer: read a stream from video camera and use tee to (a) show the stream on display and (b) write to a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gst-launch-1.0 -e v4l2src device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=640, height=480, framerate=30/1' ! tee name=t \ | |
t. ! queue ! videoconvert ! autovideosink \ | |
t. ! queue leaky=downstream ! videoconvert ! x264enc tune=zerolatency speed-preset=ultrafast key-int-max=30 byte-stream=true ! splitmuxsink muxer=mp4mux location=output.mp4 | |
Notes: | |
x264enc appears to be not playing nice with streams. Removing its options blocks the pipeline. Replacing it with vaapih264enc works but then splitmuxsink has to be replaced with filesink for some reason... | |
vaapih264enc enables hardware acceleration on systems with Intel hardware. The plugin is available if you install an extra package: sudo apt install gstreamer1.0-vaapi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment