From e74706118c987c43748b6c0a1e4208f1d460c67c Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Mon, 28 Nov 2022 14:47:23 -0500 Subject: add reload js for detecting fallback --- 2022/organizers-notebook/index.org | 59 +++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 13 deletions(-) (limited to '2022/organizers-notebook/index.org') diff --git a/2022/organizers-notebook/index.org b/2022/organizers-notebook/index.org index 82d5429e..62c4ffd3 100644 --- a/2022/organizers-notebook/index.org +++ b/2022/organizers-notebook/index.org @@ -169,18 +169,15 @@ SCHEDULED: <2022-11-28 Mon> CLOCK: [2022-11-27 Sun 15:30] :END: -ffmpeg -y -r 20 -t 3 -i sorry.png -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -shortest -c:v vp8 -color_primaries 1 -color_trc 1 -colorspace 1 sorry.webm - +ffmpeg -y -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -loop 1 -r 20 -t 10 -i sorry.png -c:v libvpx -c:a libvorbis -color_primaries 1 -color_trc 1 -colorspace 1 -crf 30 -g 120 -minrate 1.5M -b:v 1500 -g 120 -maxrate 1.5M -cluster_time_limit 5100 -shortest sorry.webm icecast 2.4.4 Stream #0:0: Video: vp8, yuv420p(tv, bt709, progressive), 1280x720, SAR 1:1 DAR 16:9, 20 fps, 20 tbr, 1k tbn, 1k tbc (default) Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default) Okay. I can ffmpeg to /gen-sorry.webm with - orga@live0:/usr/share/icecast2/web$ ffmpeg -r 20 -re -stream_loop -1 -i gen-fallback.webm -f webm -content_type video/webm -c:a copy -c:v vp8 icecast://emacsconf:$PASSWORD@localhost:8001/gen-sorry.webm + orga@live0:/usr/share/icecast2/web$ ffmpeg -r 20 -re -stream_loop -1 -i gen-fallback.webm -f webm -content_type video/webm -c:a copy -c:v copy icecast://emacsconf:$PASSWORD@localhost:8001/gen-sorry.webm - if I stream to it and not gen, I see sorry using gen's mount - If I stream to gen, I see gen, but I need to refresh (mpv or Firefox) ***** gen @@ -209,16 +206,47 @@ Input #0, matroska,webm, from 'http://live0.emacsconf.org:8001/gen.webm': :LOGBOOK: - State "DONE" from "TODO" [2022-11-27 Sun 16:25] :END: -**** TODO Add more ffmpeg options from the OBS profile to try to get them to match as closely as possible -SCHEDULED: <2022-11-28 Mon> -**** TODO Detect fallback and reload the video player -SCHEDULED: <2022-11-28 Mon> +**** DONE Add more ffmpeg options from the OBS profile to try to get them to match as closely as possible +CLOSED: [2022-11-28 Mon 14:24] SCHEDULED: <2022-11-28 Mon> +:PROPERTIES: +:Effort: 0:15 +:END: +:LOGBOOK: +CLOCK: [2022-11-28 Mon 13:24]--[2022-11-28 Mon 13:41] => 0:17 +:END: +**** DONE Detect fallback and reload the video player +CLOSED: [2022-11-28 Mon 14:46] SCHEDULED: <2022-11-28 Mon> :PROPERTIES: :CREATED: [2022-11-27 Sun 17:53] + :Effort: 0:30 + :END: + :LOGBOOK: + CLOCK: [2022-11-28 Mon 14:24]--[2022-11-28 Mon 14:46] => 0:22 :END: https://stackoverflow.com/questions/36280764/audio-stops-playing-while-moving-to-fallback-mount-using-icecast#36332739 +#+begin_src js :eval no + // @license magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt txt CC0-1.0 + // Copyright (c) 2022 Sacha Chua - CC0 Public Domain +var video = document.querySelector('video.reload'); +if (video) { + var myVar = setInterval(reloadAsNeeded, 1000); + var oldTime = ''; + function reloadAsNeeded() { + if ((video.paused != true && (video.currentTime - oldTime) == 0 && video.currentTime != 0)) { + var source = video.querySelector('source'); + var oldVideo = source.src; + source.src = ''; + source.src = oldVideo; + video.load(); + video.play(); + } + oldTime = video.currentTime; + }; +} +// @license-end +#+end_src *** TODO [#A] Make sure things are okay for me to handle both streams :sachac: SCHEDULED: <2022-11-29 Tue> :PROPERTIES: @@ -226,6 +254,7 @@ SCHEDULED: <2022-11-29 Tue> :CUSTOM_ID: both :END: **** TODO Add autokey shortcuts +SCHEDULED: <2022-11-30 Wed> **** TODO figure out left/right to keep track of both streams SCHEDULED: <2022-11-28 Mon> :PROPERTIES: @@ -266,8 +295,8 @@ can paste in https://emacsconf.org/2022/qa/ for tips. :PROPERTIES: :CUSTOM_ID: caption :END: -*** TODO Nudge volunteers to e-mail me captions by Dec 1 :mail:sachac: -SCHEDULED: <2022-11-28 Mon> +*** DONE Nudge volunteers to e-mail me captions by Dec 1 :mail:sachac: +CLOSED: [2022-11-28 Mon 13:23] SCHEDULED: <2022-11-28 Mon> *** DONE [#C] Copy chapter headings for mail talk :emacsconf:captions: CLOSED: [2022-11-28 Mon 00:23] :PROPERTIES: @@ -5227,10 +5256,14 @@ CLOSED: [2022-11-21 Mon 13:30] :PROPERTIES: :CUSTOM_ID: live-speakers :END: -*** TODO [#A] Make sure IRC talks get BBB checkin information if they need to do it live :mail: -SCHEDULED: <2022-11-28 Mon> +*** DONE [#A] Make sure IRC talks get BBB checkin information if they need to do it live :mail: +CLOSED: [2022-11-28 Mon 13:24] SCHEDULED: <2022-11-28 Mon> :PROPERTIES: :CREATED: [2022-11-23 Wed 11:24] +:Effort: 0:15 +:END: +:LOGBOOK: +CLOCK: [2022-11-28 Mon 13:23]--[2022-11-28 Mon 13:24] => 0:01 :END: survey, orgyear, lspbridge, eev, python -- cgit v1.2.3