First I really wanna thank @Centricular and specially @MathieuDuponchelle who did all the heavy lifting and made this tiny experiments even possible
This Code is part of my Gstreamer 101 with python
where I got familiar with gstreamer
inside a docker
-container and the possiblities of gstreamer
in case of WebRTC
as well as CEF
.
THX to:
-
@matthew1000 & @moschopsuk ->
Brave
where I copied more ot less the whole webserver/websocket-logic to interact with
gstreamer
-
@notedit -> gstreamer-rtc-streamer
which code helped me a lot to get
webRTC
working and structured, because I had not muchpython
knowledge
Years I wanted to have a 'headless' version of OBS
where I could overlay a Browser
over a video-stream. As I dug more into webRTC
I really wanted to bring this into the mix.
I am no python
-ninja - not even a well enough python
-dev, I would say - but I did not want to struggle with C/C++
(or more and less their build systems
) so I choose python
to interact with gstreamer
on a more deep level.
Thanks to a lot of examples
all over github
, as well as the work of the BBC
with Brave
(shout out in this case to @moschopsuk & @matthew1000 )!
- run gstreamer in
Docker
- build CEF-plugin in the
Container
to bundle it - experiment with
gstreamer
andGLib
inpython
- develop a couple of small demos with `gstreamer``
- try to build something like a news studio with graphik overlay where participants can publish via
webrtc
to be broadcasted
something like
please ignore the content, it is all about graphics and video mixing, of course!
docker build --tag=riha/gst-video-graphik-server .
-
installs
gstreamer
and all the dependencies onubuntu
19.10
(TODO: update to LTS 20.x.x, asap) -
builds the
gstcefsrc
look into the
install_scripts/install-cefPlugin.sh
.The version is pinned to a certain working commit of this plugin, just to be sure it works!
-
installs
python dependencies
TODO:
- I did not include (
COPY
) thesrc
-Folder in the container, yet because I wanna code during runtime of the container! - I do not provide an
ENTRYPOINT
because it is still a work in progress and not a product
docker run -it -p 7001:7001 -p 8001:8001 -v $PWD/src:/opt riha/gst-video-graphik-server:latest
-
opens port
8001
for the http/websocket-server for- webRTC signaling
- http-server for the webRtc ingest
- as well as HTML-graphics for the background
-
opens port
7001
to watch the stream withffmpeg
(orgstreamer
of course!)ffplay tcp://127.0.0.1:7001
-
maps the
src/
-folder to/opt
inside the container to run the code and develop/debug
inside the container
cd /opt
python3 server.py
- "DONE"
4. open `TCP`-stream on the host with
`ffplay tcp://127.0.0.1:7001`