I would like to stream web cam video to http web page. I know how to read from web cam and archive it to file.

But how to stream via web. What is the pipeline for that?

up vote 11 down vote accepted

Use hlssink element from gst-plugins-bad:

gst-launch-1.0 videotestsrc is-live=true ! x264enc ! mpegtsmux ! hlssink

It will generate playlist and segments files. You need to provide HTTP access to these files, you can use any webserver, nginx or Apache, for example.

You can tweak hlssink's parameters to specify target location, segments count, etc. All options can be listed with:

gst-inspect-1.0 hlssink

If you need better low-level control, you'd better create your own web server with libsoup, manually split MPEG-TS into segments and add your own playlist endpoint.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.