Last active
September 23, 2021 05:27
-
-
Save GeekBrony/0c8e74198f67b52f7d0c to your computer and use it in GitHub Desktop.
Liquidsoap Video Stream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/liquidsoap | |
# Liquidsoap Script for Bronydom Video Stream (for streaming to an Icecast2 server) | |
# Doesn't support RTMP yet, also needs a pretty powerful server to handle. | |
# Set/change the following: | |
# hostname, portno, passw, mountpoint | |
# playlistdir (directory of all the videos, automatically recursively searches for files) | |
# The default values require a local instance of Icecast2 to be running. | |
hostname = "localhost" | |
portno = "8000" | |
passw = "hackme" | |
mountpoint = "/video" | |
playlistdir = "~/Videos/" | |
set("log.file",false) | |
set("log.file.path","/path/to/log/file") | |
# Nah, we don't need log files right now, we can just go to the console for that. | |
set("log.stdout", true) | |
set("log.level",3) # Set loglevel to 3, for debugging purposes. | |
# Set 480p resolution @ 24fps | |
set("frame.video.width", 848) | |
set("frame.video.height", 480) | |
set("frame.video.samplerate", 24) | |
# Now we setup the video source. If no videos are located, fallback to a blank stream. | |
source = playlist(playlistdir) | |
security = blank(id="blank") | |
videostream = fallback(track_sensitive = false, [source, security]) | |
# GStreamer outputs require this so that Liquidsoap doesn't handle syncing, but rather GStreamer itself | |
clock.assign_new(sync=false,[videostream]) | |
# Now we output to the Icecast2 server. | |
output.icecast( | |
%ogg( | |
%theora( | |
quality=20, | |
width=848, | |
height=480 | |
), | |
%vorbis.cbr( | |
samplerate=44100, | |
channels=2, | |
bitrate=128 | |
)), | |
format="video/ogg", | |
host=hostname, | |
port=portno, | |
password=passw, | |
mount=mountpoint, | |
icy_metadata="false", | |
fallible=true, videostream) | |
# End of script. That's all it takes :D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello bro,
Thanks for your sharing, can you share your php script for processing metadata :D?