Created
January 12, 2021 13:01
-
-
Save 17183248569/49b3a05c6ff2e965e0d83ab2ccd0d3c9 to your computer and use it in GitHub Desktop.
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
import subprocess | |
import numpy | |
x=subprocess.Popen(["ffmpeg","-re","-f","rawvideo","-s","250x250","-pix_fmt","rgb24","-i","-", | |
"-vcodec", "libx264", | |
"-acodec", "aac", "-b:a", "192k", | |
"-f", "flv", | |
"rtmp://live-push.bilivideo.com/live-bvc/?streamname=************"],stdin=subprocess.PIPE,stderr=subprocess.PIPE) | |
data=numpy.ndarray([250,250,3],"u1") | |
data[:][:]=[255,0,0] | |
data[100:150,0:200]=[0,56,0] | |
while 1: | |
x.stdin.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment