summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-12-01 19:23:36 -0500
committerSacha Chua <sacha@sachachua.com>2022-12-01 19:23:36 -0500
commit0a7edf0d333d5959d75c9934ce23f19bb399b6e2 (patch)
tree93209b36d2810577b291ce23a3493b546e532773
parent853bdd7683e96a02dfbde7dc32146ead29ca7591 (diff)
downloademacsconf-el-0a7edf0d333d5959d75c9934ce23f19bb399b6e2.tar.xz
emacsconf-el-0a7edf0d333d5959d75c9934ce23f19bb399b6e2.zip
intro checking
-rw-r--r--emacsconf-publish.el10
-rw-r--r--emacsconf-stream.el74
-rw-r--r--emacsconf.el11
3 files changed, 56 insertions, 39 deletions
diff --git a/emacsconf-publish.el b/emacsconf-publish.el
index 2701cf1..f37c654 100644
--- a/emacsconf-publish.el
+++ b/emacsconf-publish.el
@@ -1585,8 +1585,10 @@ This video is available under the terms of the Creative Commons Attribution-Shar
(let ((main (expand-file-name (concat (plist-get talk :video-slug) "--main.webm")
emacsconf-cache-dir)))
(emacsconf-with-talk-heading talk
- (let* ((video-file-name (emacsconf-get-preferred-video (org-entry-get (point) "VIDEO_SLUG")))
+ (let* ((video-file-name (emacsconf-get-preferred-video (plist-get talk :video-slug)))
(video-file (and video-file-name (expand-file-name video-file-name emacsconf-cache-dir)))
+ (intro-file (expand-file-name (concat (plist-get talk :slug) ".webm")
+ (expand-file-name "intros" emacsconf-stream-asset-dir)))
duration)
(unless (file-exists-p main)
(setq main video-file-name))
@@ -1603,7 +1605,11 @@ This video is available under the terms of the Creative Commons Attribution-Shar
(unless (plist-get talk :video-duration)
(setq duration (/ (compile-media-get-file-duration-ms video-file) 1000))
(org-entry-put (point) "VIDEO_DURATION" (format-seconds "%m:%.2s" duration))
- (org-entry-put (point) "VIDEO_TIME" (number-to-string (ceiling (/ duration 60))))))))))
+ (org-entry-put (point) "VIDEO_TIME" (number-to-string (ceiling (/ duration 60))))))
+ (when (file-exists-p intro-file)
+ (org-entry-put
+ (point) "INTRO_TIME"
+ (number-to-string (ceiling (/ (compile-media-get-file-duration-ms intro-file) 60000)))))))))
(defvar emacsconf-youtube-channel-id "UCwuyodzTl_KdEKNuJmeo99A")
(defun emacsconf-youtube-edit ()
diff --git a/emacsconf-stream.el b/emacsconf-stream.el
index 5d38c12..a5106e0 100644
--- a/emacsconf-stream.el
+++ b/emacsconf-stream.el
@@ -211,31 +211,45 @@ especially when two things need to happen close together."
(interactive (list (emacsconf-complete-talk-info)))
(setq talk (emacsconf-resolve-talk talk))
(when (or (not (boundp 'org-state)) (string= org-state "PLAYING"))
- (emacsconf-stream-track-ssh
- talk
- (cons
- "nohup"
- (cond
- ((and
- (plist-get talk :recorded-intro)
- (plist-get talk :video-file)) ;; recorded intro and recorded talk
- (message "should automatically play intro and recording")
- (list "play-with-intro" (plist-get talk :slug))) ;; todo deal with stream files
- ((and
- (plist-get talk :recorded-intro)
- (null (plist-get talk :video-file))) ;; recorded intro and live talk; play the intro and join BBB
- (message "should automatically play intro; join %s" (plist-get talk :bbb-backstage))
- (list "intro" (plist-get talk :slug)))
- ((and
- (null (plist-get talk :recorded-intro))
- (plist-get talk :video-file)) ;; live intro and recorded talk, show slide and use Mumble; manually play talk
- (message "should show intro slide; play %s afterwards" (plist-get talk :slug))
- (list "intro" (plist-get talk :slug)))
- ((and
- (null (plist-get talk :recorded-intro))
- (null (plist-get talk :video-file))) ;; live intro and live talk, join the BBB
- (message "join %s for live intro and talk" (plist-get talk :bbb-backstage))
- (list "bbb" (plist-get talk :slug))))))))
+ (if (plist-get talk :stream-files)
+ (progn
+ (emacsconf-stream-track-ssh
+ talk
+ "overlay"
+ (plist-get talk :slug))
+ (emacsconf-stream-track-ssh
+ talk
+ (append
+ (list
+ "nohup"
+ "mpv")
+ (split-string-and-unquote (plist-get talk :stream-files))
+ (list "&"))))
+ (emacsconf-stream-track-ssh
+ talk
+ (cons
+ "nohup"
+ (cond
+ ((and
+ (plist-get talk :recorded-intro)
+ (plist-get talk :video-file)) ;; recorded intro and recorded talk
+ (message "should automatically play intro and recording")
+ (list "play-with-intro" (plist-get talk :slug))) ;; todo deal with stream files
+ ((and
+ (plist-get talk :recorded-intro)
+ (null (plist-get talk :video-file))) ;; recorded intro and live talk; play the intro and join BBB
+ (message "should automatically play intro; join %s" (plist-get talk :bbb-backstage))
+ (list "intro" (plist-get talk :slug)))
+ ((and
+ (null (plist-get talk :recorded-intro))
+ (plist-get talk :video-file)) ;; live intro and recorded talk, show slide and use Mumble; manually play talk
+ (message "should show intro slide; play %s afterwards" (plist-get talk :slug))
+ (list "intro" (plist-get talk :slug)))
+ ((and
+ (null (plist-get talk :recorded-intro))
+ (null (plist-get talk :video-file))) ;; live intro and live talk, join the BBB
+ (message "join %s for live intro and talk" (plist-get talk :bbb-backstage))
+ (list "bbb" (plist-get talk :slug)))))))))
(defun emacsconf-stream-get-filename (talk)
"Return the local filename for the video file for TALK.
@@ -249,15 +263,7 @@ Final files should be stored in /data/emacsconf/stream/YEAR/video-slug--main.web
(interactive (list (emacsconf-complete-talk-info)))
(setq talk (emacsconf-resolve-talk talk))
(emacsconf-stream-track-ssh
- talk
- (append
- (list
- "nohup"
- "play"
- (plist-get talk :slug))
- (if (stringp (plist-get talk :stream-files))
- (split-string-and-unquote (plist-get talk :stream-files))
- (plist-get talk :stream-files)))))
+ talk "nohup" "play" (plist-get talk :slug)))
(defun emacsconf-stream-play-video-file (talk filename)
(interactive (list (emacsconf-complete-talk-info)))
diff --git a/emacsconf.el b/emacsconf.el
index 608f4dc..7a91bcb 100644
--- a/emacsconf.el
+++ b/emacsconf.el
@@ -403,6 +403,7 @@
(:stream-files "STREAM_FILES")
(:youtube-url "YOUTUBE_URL")
(:toobnix-url "TOOBNIX_URL")
+ (:intro-time "INTRO_TIME")
;; Captioning
(:captioner "CAPTIONER")
(:caption-note "CAPTION_NOTE")
@@ -597,8 +598,11 @@
(seconds-to-time (time-subtract (plist-get o :start-time) (seconds-to-time 3600)))))
(plist-put o :live-time
(seconds-to-time
- (time-add (plist-get o :start-time)
- (seconds-to-time (* 60 (string-to-number (plist-get o :video-time)))))))
+ (+
+ (time-to-seconds (plist-get o :start-time))
+ (* 60 (string-to-number (or (plist-get o :video-time) "0")))
+ (* 60 (string-to-number (or (plist-get o :video-time) "0")))
+ )))
(plist-put o :qa-time
(plist-get o :live-time))
@@ -1049,6 +1053,7 @@
:stream ,(concat emacsconf-stream-base "gen.webm")
:480p ,(concat emacsconf-stream-base "gen-480p.webm")
:youtube-url "https://youtu.be/bLJdyzt51uw"
+ :youtube-studio-url "https://studio.youtube.com/video/bLJdyzt51uw/livestreaming"
:toobnix-url "https://toobnix.org/w/7t9X8eXuSby8YpyEKTb4aj"
:start "09:00" :end "17:00"
:vnc-display ":5"
@@ -1060,7 +1065,7 @@
:tramp "/ssh:emacsconf-dev@res.emacsconf.org#46668:"
:toobnix-url "https://toobnix.org/w/w6K77y3bNMo8xsNuqQeCcD"
:youtube-url "https://youtu.be/4W9ZvCTG0Ug"
- :youtube-studio-url "https://studio.youtube.com/video/bLJdyzt51uw/livestreaming"
+ :youtube-studio-url "https://studio.youtube.com/video/4W9ZvCTG0Ug/livestreaming"
:stream ,(concat emacsconf-stream-base "dev.webm")
:480p ,(concat emacsconf-stream-base "dev-480p.webm")
:start "10:00" :end "17:00"