2 Broadcasting
A broadcast is a global pipeline that can be controlled through the Overscan DSL, and provides a global event bus.
procedure
(make-broadcast video-source audio-source flv-sink #:name name #:preview video-preview #:monitor audio-monitor #:h264-encoder h264-encoder #:aac-encoder aac-encoder) → (or/c (is-a?/c pipeline%) #f) video-source : (is-a?/c element%) audio-source : (is-a?/c element%) flv-sink : (is-a?/c element%) name : (or/c string? false/c) video-preview : (is-a?/c element%) audio-monitor : (is-a?/c element%) h264-encoder : (is-a?/c element%) aac-encoder : (is-a?/c element%)
procedure
(broadcast [ video-source audio-source flv-sink] #:name name #:preview video-preview #:monitor audio-monitor #:h264-encoder h264-encoder #:aac-encoder aac-encoder) → (is-a?/c pipeline%) video-source : (is-a?/c element%) = (videotestsrc) audio-source : (is-a?/c element%) = (audiotestsrc)
flv-sink : (is-a?/c element%) = (filesink (make-temporary-file)) name : (or/c string? false/c) video-preview : (is-a?/c element%) audio-monitor : (is-a?/c element%) h264-encoder : (is-a?/c element%) aac-encoder : (is-a?/c element%)
procedure
procedure
(stop [#:timeout timeout])
→ (one-of/c 'failure 'success 'async 'no-preroll) timeout : exact-nonnegative-integer? = 5
procedure
(kill-broadcast) → void?
procedure
(add-listener listener) → exact-nonnegative-integer?
listener : (-> message? (is-a?/c pipeline%) any)
procedure
(remove-listener id) → void?
id : exact-nonnegative-integer?
procedure
path : path-string? pipeline : (is-a?/c pipeline%) = (get-current-broadcast)
value
2.1 Twitch
(require overscan/twitch) | package: overscan |
Twitch.tv is a live streaming community. To broadcast to Twitch, get a stream key from the dashboard settings and use it as a parameter to twitch-sink with twitch-stream-key.
parameter
(twitch-stream-key key) → void? key : string?
= (getenv "TWITCH_STREAM_KEY")
procedure
(twitch-sink [#:test bandwidth-test?]) → rtmpsink?
bandwidth-test? : boolean? = #f
2.2 macOS
(require overscan/macos) | package: overscan |
Overscan was developed primarily on a computer running macOS. This module provides special affordances for working with Apple hardware and frameworks.
Putting all the pieces together, to broadcast a camera and a microphone to Twitch, preview the video, and monitor the audio, you would call:
#lang overscan (require overscan/macos) (call-atomically-in-run-loop (λ () (broadcast (camera 0) (audio 0) (twitch-sink) #:preview (osxvideosink) #:monitor (osxaudiosink))))
value
audio-sources : (vectorof (is-a?/c device%))
value
camera-sources : (vectorof (-> (is-a?/c element%)))
value
screen-sources : (vectorof (-> (is-a?/c element%)))
procedure
pos : exact-nonnegative-integer?
procedure
pos : exact-nonnegative-integer?
procedure
(screen pos [ #:capture-cursor cursor? #:capture-clicks clicks?]) → (is-a?/c element%) pos : exact-nonnegative-integer? cursor? : boolean? = #f clicks? : boolean? = #f
procedure
(osxvideosink [name]) → (element/c "osxvideosink")
name : (or/c string? #f) = #f
procedure
(osxaudiosink [name]) → (element/c "osxaudiosink")
name : (or/c string? #f) = #f
procedure
(call-atomically-in-run-loop thunk) → any
thunk : (-> any)
2.3 Drawing
(require overscan/draw) | package: overscan |
procedure
(make-drawable element [ #:width width #:height height]) →
(or/c (is-a?/c bin%) #f) (is-a?/c bitmap-dc%) element : (is-a?/c element%) width : exact-nonnegative-integer? = 1280 height : exact-nonnegative-integer? = 720