Skip to content

Instantly share code, notes, and snippets.

@tedkulp
Created September 20, 2021 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tedkulp/a6ccf182549a628d61d241cee70f08d5 to your computer and use it in GitHub Desktop.
Save tedkulp/a6ccf182549a628d61d241cee70f08d5 to your computer and use it in GitHub Desktop.
Script to generate test video stream and stream to rtmp
#!/bin/bash
./videogen.sh -f flv "rtmp://some-rtmp-server:1935/live/some-key-maybe-goes-here"
#!/bin/bash
# https://news.mistserver.org/news/88/Generating+a+live+test+stream+from+a+server+using+command+line
ffmpeg -re -f lavfi -i "aevalsrc=if(eq(floor(t)\,ld(2))\,st(0\,random(4)*3000+1000))\;st(2\,floor(t)+1)\;st(1\,mod(t\,1))\;(0.6*sin(1*ld(0)*ld(1))+0.4*sin(2*ld(0)*ld(1)))*exp(-4*ld(1)) [out1]; testsrc=r=30:s=1280x720,drawtext=borderw=5:fontcolor=white:fontsize=30:text='%{localtime}/%{pts\:hms}':x=\(w-text_w\)/2:y=\(h-text_h-line_h\)/2 [out0]" \
-acodec aac -vcodec h264 -strict -2 -pix_fmt yuv420p -profile:v baseline -level 3.0 \
$@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment