Last active
July 31, 2023 00:21
-
-
Save DuendeInexistente/4d0ccbc6632afca79e209cfae1934c7d to your computer and use it in GitHub Desktop.
Use krita's internal recorder to stream the canvas directly
This file contains 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
strem.jpg | |
*.un~ |
This file contains 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
#!/bin/bash | |
#Run in root recording folder, set filename after -m to the folder of the file being streamed. | |
inotifywait -m ./20230725114947 -e close_write | | |
while read dir action file; do | |
echo "The file '$file' appeared in directory '$dir' via '$action'" | |
cp -f $dir$file ./strem.jpg ; echo "file copied" | |
# do something with the file | |
done |
This file contains 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/bin/bash | |
#Stream the file. CHange the scale= filter to define the resizing, leave it at 1 for no resizing. Line necesary to prevent non-divisible-by-2 errors | |
site=rtmp://a.rtmp.youtube.com/live2 | |
site=rtmp://live.us.picarto.tv/golive | |
ffmpeg \ | |
-re \ | |
-framerate 15 \ | |
-loop 1 \ | |
-f image2 \ | |
-s:v 2048x2048 \ | |
-i "./strem.jpg" \ | |
-c:v libx264 \ | |
-c:a libmp3lame \ | |
-preset superfast \ | |
-tune zerolatency \ | |
-filter_complex "scale=iw/4:ih/4,pad=ceil(iw/2)*2:ceil(ih/2)*2" \ | |
-pix_fmt yuv420p \ | |
-r 15 \ | |
-f flv $site/$key | |
exit | |
#-f flv rtmp://a.rtmp.youtube.com/live2/$key | |
# -f tee "[f=flv:onfail=ignore]$site$pickey|[f=segment:strftime=1:segment_time=60]local_%F_%H-%M-%S.mkv" | |
-s 2048x2048 \ | |
# -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \ | |
# -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \ | |
# -f flv "$YOUTUBE_URL/$KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment