Skip to content

Instantly share code, notes, and snippets.

View ryankrage77's full-sized avatar

Ryan Krage ryankrage77

View GitHub Profile
@ryankrage77
ryankrage77 / stream.sh
Created May 8, 2022 12:48
raspivid stream to RTMP server with ffmpeg
raspivid -t 0 -o - -b 2500000 --profile high --level 4.2 -md 4 -fps 25 -br 60 -fli 50hz -n | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16l e -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -f flv rtmp://[your RTMP server]:[port]/live/streamkey
#RASPIVID OPTIONS
#-t 0
#run forever. change 0 to a time in milliseconds to only stream for a limited time.
#-o -
#output to stdout
#-b 2500000
#bitrate in bits/s. Shouldn't need to go above 6mbps.
#--profile high --level 4.2
@ryankrage77
ryankrage77 / collatz.py
Created August 10, 2021 17:54
program to check if numbers disprove the Collatz conjecture
import multiprocessing as mp
def worker(num):
a = num
b=0
#if a becomes smaller than the number we are currently testing, then it is a previously tested number, and so we can discard the test.
while a!=1 and a >= num:
if a%2==0:
a=(a/2)
else: