Advertisement
nbatothemax

Untitled

May 5th, 2019
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. height = 240
  2. width = 320
  3.  
  4. out, _ = (
  5. ffmpeg
  6. .input('in.mp4')
  7. .output('pipe:', format='rawvideo', pix_fmt='rgb24')
  8. .run(capture_stdout=True)
  9. )
  10.  
  11. send = (
  12. ffmpeg
  13. .input('pipe:', format='rawvideo', pix_fmt='rgb24')
  14. .output('rtsp://10.0.0.37:3333')
  15. .run_async(pipe_stdin=True)
  16. )
  17.  
  18. video = (
  19. np
  20. .frombuffer(out, np.uint8)
  21. .reshape([-1, height, width, 3])
  22. )
  23.  
  24. send.stdin.write(video[0].tobytes())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement