I want to perform HLS (HTTP Live Streaming) using Gstreamer

后端 未结 1 1734
既然无缘
既然无缘 2021-02-06 11:30

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?<

相关标签:
1条回答
  • 2021-02-06 12:02

    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.

    0 讨论(0)
提交回复
热议问题