0

I'm trying to pipe pygame camera output to FFmpeg in ubuntu. But it is showing

Broken pipe error.

Here is my code:

proc = Popen(['ffmpeg', '-y', '-f', 'rawvideo', '-vcodec', 'rawvideo', '-r', '24', '-i', '-', '-vcodec', 'mpeg4', '-q:a', '5', '-r', '24', 'video.avi'], stdin=PIPE)

proc.stdin.write(pil_string_image)
for i in range(100):
  image = cam.get_image()
  pil_string_image = pg.image.tostring(image, "RGBA", False)
  proc.stdin.write(pil_string_image)
proc.stdin.close()
proc.stderr.close()
proc.wait()

I'm new to programming and like to learn programming by developing applications.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
Chakri
  • 49
  • 5

0 Answers0