Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from subprocess import Popen,PIPE
- import sys
- p = Popen('ffmpeg -y -f rawvideo -pix_fmt gray -s:v 1280x720 -r 25 -i - 1.mp4'.split(" "),
- stdin=PIPE,
- stderr=sys.stdout,
- stdout=sys.stdout
- )
- a = np.zeros((1280,720),np.uint8)
- for cnt in range(10000):
- for x in range(1280):
- for y in range(720):
- if ((cnt + x%8) %2)!=((y%8)%2):
- a[x,y] = 255
- #a.tofile(sys.stdout)
- #print(p.communicate(a.tobytes()))
- p.stdin.write(a.tobytes())
- p.stdin.close()
Advertisement
Add Comment
Please, Sign In to add comment