Skip to content

Instantly share code, notes, and snippets.

@taylor224
Created February 27, 2017 10:55
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 taylor224/9c1fa1131752712e90213baf0f5f5c48 to your computer and use it in GitHub Desktop.
Save taylor224/9c1fa1131752712e90213baf0f5f5c48 to your computer and use it in GitHub Desktop.
ffmpeg stream to UStream with python
command = "ffmpeg -f avfoundation -i \":0\" -f rawvideo -pix_fmt bgr24 -s 1280x720 -i - -deinterlace -vb 2000k -vcodec libx264 -preset ultrafast -g 60 -threads 4 -acodec libmp3lame -ab 128k -ar 22050 -bufsize 512k -f flv \"rtmp://1.1234567.fme.ustream.tv/ustreamVideo/id/streamkey\"
videopipe = subprocess.Popen(pipecommand, shell=True, stdin=subprocess.PIPE)
videopipe.stdin.write(frame.tostring()) # OpenCV Frame Data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment