Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sergio Vergata
BigBlueButton LiveStreaming
Commits
8b700665
Unverified
Commit
8b700665
authored
May 11, 2020
by
Michael Koscher
Committed by
GitHub
May 11, 2020
Browse files
Merge pull request #13 from aau-zid/changeCodecToH264
Change codec to h264, improve FFMPEG Settings, write Notification in chat
parents
1c69dea0
943260bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8b700665
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
Streams a given BBB Meeting to an RTMP Server.
Streams a given BBB Meeting to an RTMP Server.
*License:*
[
GNU GPL v3 or later
](
http://www.gnu.org/copyleft/gpl.html
)
## Getting Started
## Getting Started
### Prerequisites
### Prerequisites
...
...
chat.py
View file @
8b700665
...
@@ -60,6 +60,9 @@ def bbb_browser():
...
@@ -60,6 +60,9 @@ def bbb_browser():
element
=
EC
.
invisibility_of_element
((
By
.
CSS_SELECTOR
,
'.ReactModal__Overlay'
))
element
=
EC
.
invisibility_of_element
((
By
.
CSS_SELECTOR
,
'.ReactModal__Overlay'
))
WebDriverWait
(
browser
,
selelnium_timeout
).
until
(
element
)
WebDriverWait
(
browser
,
selelnium_timeout
).
until
(
element
)
browser
.
find_element_by_id
(
'message-input'
).
send_keys
(
"Viewers can send messages to this meeting"
)
browser
.
find_elements_by_css_selector
(
'[aria-label="Send message"]'
)[
0
].
click
()
redis_r
=
redis
.
Redis
(
host
=
args
.
redis
,
charset
=
"utf-8"
,
decode_responses
=
True
)
redis_r
=
redis
.
Redis
(
host
=
args
.
redis
,
charset
=
"utf-8"
,
decode_responses
=
True
)
redis_s
=
redis_r
.
pubsub
()
redis_s
=
redis_r
.
pubsub
()
redis_s
.
psubscribe
(
**
{
args
.
channel
:
chat_handler
})
redis_s
.
psubscribe
(
**
{
args
.
channel
:
chat_handler
})
...
...
stream.py
View file @
8b700665
...
@@ -58,10 +58,14 @@ def bbb_browser():
...
@@ -58,10 +58,14 @@ def bbb_browser():
element
=
EC
.
invisibility_of_element
((
By
.
CSS_SELECTOR
,
'.ReactModal__Overlay'
))
element
=
EC
.
invisibility_of_element
((
By
.
CSS_SELECTOR
,
'.ReactModal__Overlay'
))
WebDriverWait
(
browser
,
selelnium_timeout
).
until
(
element
)
WebDriverWait
(
browser
,
selelnium_timeout
).
until
(
element
)
browser
.
find_element_by_id
(
'message-input'
).
send_keys
(
"This meeting will be stream to the following address: %s"
%
args
.
target
)
browser
.
find_elements_by_css_selector
(
'[aria-label="Send message"]'
)[
0
].
click
()
browser
.
find_elements_by_id
(
'chat-toggle-button'
)[
0
].
click
()
browser
.
find_elements_by_id
(
'chat-toggle-button'
)[
0
].
click
()
browser
.
find_elements_by_css_selector
(
'button[aria-label="Users and messages toggle"]'
)[
0
].
click
()
browser
.
find_elements_by_css_selector
(
'button[aria-label="Users and messages toggle"]'
)[
0
].
click
()
browser
.
execute_script
(
"document.querySelector('[aria-label=
\"
Users and messages toggle
\"
]').style.display='none';"
)
browser
.
execute_script
(
"document.querySelector('[aria-label=
\"
Users and messages toggle
\"
]').style.display='none';"
)
browser
.
execute_script
(
"document.querySelector('[aria-label=
\"
Options
\"
]').style.display='none';"
)
browser
.
execute_script
(
"document.querySelector('[aria-label=
\"
Options
\"
]').style.display='none';"
)
browser
.
execute_script
(
"document.querySelector('[aria-label=
\"
Actions bar
\"
]').style.display='none';"
)
browser
.
execute_script
(
"document.getElementById('container').setAttribute('style','margin-bottom:30px');"
)
def
get_join_url
():
def
get_join_url
():
minfo
=
bbb
.
get_meeting_info
(
args
.
id
)
minfo
=
bbb
.
get_meeting_info
(
args
.
id
)
...
@@ -76,8 +80,10 @@ def watch():
...
@@ -76,8 +80,10 @@ def watch():
time
.
sleep
(
60
)
time
.
sleep
(
60
)
def
stream
():
def
stream
():
logging
.
info
(
'Starting Stream with cmd: ffmpeg -fflags +igndts -f x11grab -s 1920x1080 -r 24 -draw_mouse 0 -i :%d -f alsa -i pulse -ac 2 -preset ultrafaset -crf 0 -pix_fmt yuv420p -s 1920x1080 -c:a aac -b:a 160k -ar 44100 -threads 0 -f flv "%s"'
%
(
122
,
args
.
target
))
audio_options
=
'-f alsa -i pulse -ac 2 -c:a aac -b:a 160k -ar 44100'
ffmpeg_stream
=
'ffmpeg -fflags +igndts -f x11grab -s 1920x1080 -r 24 -draw_mouse 0 -i :%d -f alsa -i pulse -ac 2 -preset ultrafaset -pix_fmt yuv420p -s 1920x1080 -c:a aac -b:a 160k -ar 44100 -threads 0 -f flv "%s"'
%
(
122
,
args
.
target
)
#video_options = ' -c:v libvpx-vp9 -b:v 2000k -crf 33 -quality realtime -speed 5'
video_options
=
'-c:v libx264 -x264-params "nal-hrd=cbr" -vf format=yuv420p -b:v 4000k -g 60 -preset ultrafast -tune zerolatency'
ffmpeg_stream
=
'ffmpeg -thread_queue_size 512 -f x11grab -draw_mouse 0 -s 1920x1080 -i :%d %s -threads 0 %s -f flv "%s"'
%
(
122
,
audio_options
,
video_options
,
args
.
target
)
ffmpeg_args
=
shlex
.
split
(
ffmpeg_stream
)
ffmpeg_args
=
shlex
.
split
(
ffmpeg_stream
)
p
=
subprocess
.
Popen
(
ffmpeg_args
)
p
=
subprocess
.
Popen
(
ffmpeg_args
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment