Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'Cham' basic online live Videostream capability #1743

Open
wants to merge 54 commits into
base: master
Choose a base branch
from

Conversation

m-anish
Copy link
Contributor

@m-anish m-anish commented Jun 19, 2019

This PR adds basic live video streaming capability to the IIAB. It installs nginx from source alongside the mod-rtmp module. After this playbook is installed and running, a client can stream video to IIAB (through any rtmp streaming software like OBS - Open Broadcaster Studio), and users will be able to watch the stream at http://box.lan:8081 (which is the port used by nginx).

This playbook should run on all IIAB supported platforms (rpi, amd64-debian/ubuntu). Potential issues may be the names of the packages which are installed as dependencies which may break the compile of nginx. So please test. I have done so on ubuntu 18.04.2

@holta holta added this to the 7.1 milestone Jun 19, 2019
@holta holta changed the title Add basic online live Videostream capability Add 'Cham' basic online live Videostream capability Jun 20, 2019
@holta
Copy link
Member

holta commented Jun 20, 2019

@m-anish wants us to consider this for inclusion within IIAB 7.0 during our "feature freeze" call starting in just over 12 h from now: http://minutes.iiab.io

FYI the web site for 'Cham' itself is emerging here: https://github.com/eka-foundation/cham

Refs: #1546, PR #1733

@holta holta requested a review from georgejhunt June 20, 2019 02:21
roles/cham/defaults/main.yml Outdated Show resolved Hide resolved
@georgejhunt
Copy link
Contributor

georgejhunt commented Jun 20, 2019 via email

@holta
Copy link
Member

holta commented Jun 20, 2019

As to whenever this is ready to merge, @m-anish has a strong sentence he's provided here (for http://FAQ.IIAB.IO Item 9, IIAB's
showcase table of IIAB Apps) to illustrate Cham's purpose & possibilities:

Cham is a lightweight live video streaming platform with adaptive bitrates for Internet-in-a-Box.

@holta
Copy link
Member

holta commented Jun 21, 2019

@m-anish

  1. Can you explain this PR Add 'Cham' basic online live Videostream capability #1743's design for @georgejhunt, so he understands why you're compiling NGINX from source? This approach (can/often) make for incredibly-hard-to-maintain software & forward-going support paths.

    Also/separately: if NGINX were to become a mainline part of IIAB in the distant future, how might that be navigated/integrated? (In resource-tight environments like RPi especially!)

  2. What does 'live video streaming' mean here?

    Are you saying that video files cannot be streamed? (i.e. that only live events can be streamed, with a video camera or similar?)

    See the bottom of http://FAQ.IIAB.IO Item 9. So that the explanation (of what Cham is, and what Cham does, with a 'Getting Started' for less technical operators if at all possible?) is crystal clear to as many people as possible, going a bit beyond https://github.com/m-anish/iiab/blob/videostream/roles/cham/README.rst, Thanks!

@holta holta modified the milestones: 7.1, 7.0 Jun 21, 2019
@holta
Copy link
Member

holta commented Jun 23, 2019

@m-anish writes:

I rebased the video streaming PR as well on current master

if you feel like having a look

to george's question, most of the tutorials we saw for rtmp seemed to want to compile nginx from source and include the rtmp module in

but at a later stage it wont be much of an issue to use the system package

but we have no bandwidth to test that right now

this is something which is simple, small, works, doesn't disturb system files

@m-anish
Copy link
Contributor Author

m-anish commented Jun 25, 2019

To be honest, the system packages for nginx should also probably work, but they bring extra clutter (read system bureaucracy) which starts to make sense when we use nginx more widely. Right now with this PR, nginx just serves this one web app.

And it's pretty impressive in what it does. Give it an rtmp stream, and it will give you an adaptive bitrate output hls stream.

Is it suitable for an rpi. It should work, but I would probably limit the transcoding defined in the conf file to maximum one stream, and I would also explore if the rpi offers any hardware encoding of videos. So, this can work on a pi, with a different nginx.conf file (which doesn't place a lot of load on system resources).

I don't mind bumping this to 7.1 at all! Lets make it more feature ready. Until then, I would love more testing, on more platforms.

Update: I also added support for VAAPI (hardware accelerated encoding) when this runs on platforms where that option is there (like intel kaby-lake based NUC's). This greatly reduces system load while streaming is happening, and now we start to get into territory of asking (okay how many parallel live streams can we do?)

@holta
Copy link
Member

holta commented Jun 25, 2019

Thank you @m-anish

I agree this great work should be bumped to IIAB 7.1

But we can refine that decision during Thursday's community/team call (http://minutes.iiab.io)

@holta holta modified the milestones: 7.0, 7.1 Jun 27, 2019
@tim-moody
Copy link
Contributor

default vars:

nginx_etc_dir: /etc/nginx
nginx_config_dir: {{ nginx_etc_dir }}/conf.d

@m-anish
Copy link
Contributor Author

m-anish commented Jan 5, 2020

default vars:

nginx_etc_dir: /etc/nginx
nginx_config_dir: {{ nginx_etc_dir }}/conf.d

cool. I'll make the changes. Thanks for the tip :)

declare {{ nginx_etc_dir }}
put it in {{ nginx_etc_dir }}/protocols.d and include {{ nginx_etc_dir }}/protocols.d/*

this should probably happen in the role that installs nginx?

1 similar comment
@m-anish
Copy link
Contributor Author

m-anish commented Jan 5, 2020

default vars:

nginx_etc_dir: /etc/nginx
nginx_config_dir: {{ nginx_etc_dir }}/conf.d

cool. I'll make the changes. Thanks for the tip :)

declare {{ nginx_etc_dir }}
put it in {{ nginx_etc_dir }}/protocols.d and include {{ nginx_etc_dir }}/protocols.d/*

this should probably happen in the role that installs nginx?

@tim-moody
Copy link
Contributor

I would use iiab/vars/default_vars.yml for the variables
I would create /etc/nginx/protocols.d in nginx role (or wherever other nginx dirs are created)

@m-anish
Copy link
Contributor Author

m-anish commented Jan 5, 2020

@tim-moody done. please review :)

@m-anish
Copy link
Contributor Author

m-anish commented Jan 5, 2020

these last two reverts were per @jvonau recommendation, to leave protocols.d dir creation in install.yml

@tim-moody
Copy link
Contributor

protocol.d belongs with nginx. what if another app needs it too?

@m-anish
Copy link
Contributor Author

m-anish commented Jan 5, 2020

protocol.d belongs with nginx. what if another app needs it too?

its part of the nginx role. it will get installed as part of a regular iiab install. me and jerry were just discussing where to best put it in the nginx playbook

@holta
Copy link
Member

holta commented Jan 9, 2020

Cham (and this PR) were extensively discussed during today's Internet-in-a-Box (IIAB) call — please see the notes/minutes here: http://minutes.iiab.io

Refs: #2209 #2157 eka-foundation/home#31

@mitra42 mitra42 mentioned this pull request Jan 29, 2020
@holta holta modified the milestones: 7.1, 7.2 Apr 8, 2020
@holta holta modified the milestones: 7.2, 8.0 Sep 10, 2020
@jvonau jvonau mentioned this pull request Aug 29, 2021
@holta holta modified the milestones: 8.0, 8.1 Jan 1, 2022
@holta holta modified the milestones: 8.1, 8.2 Jan 1, 2023
@holta holta modified the milestones: 8.2, 8.3 Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants