Skip to content

Instantly share code, notes, and snippets.

@rounakdatta
Last active June 23, 2019 06:24
Show Gist options
  • Save rounakdatta/1d88ae6b12dc8f2a370cd2ba0b76c88b to your computer and use it in GitHub Desktop.
Save rounakdatta/1d88ae6b12dc8f2a370cd2ba0b76c88b to your computer and use it in GitHub Desktop.
gstreamer -> (tcp / zmq) and display it on the browser

Note that here streaming is occuring over TCP thereby would be supported by Firefox, and not Chrome.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>gst-stream</title>
</head>
<body>
<video width=320 height=240 autoplay>
<source src="http://127.0.0.1:8080">
</video>
</body>
</html>
gst-launch-1.0 \
v4l2src device=/dev/video0 \
! videoconvert ! videoscale ! video/x-raw,width=320,height=240 \
! clockoverlay shaded-background=true font-desc="Sans 38" \
! theoraenc ! oggmux ! tcpserversink host=127.0.0.1 port=8080
gst-launch-1.0 videotestsrc ! video/x-raw, format=I420, width=640, height=480, framerate=30/1 ! zmqsink
@rounakdatta
Copy link
Author

General note: Use the generic autovideosrc instead of platform specific v4l2src (Linux) or osxvideosrc (OSX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment