Edit: Maybe the GridOut
isn't a proper implementation of python file objects. My last suggestion is to try using a memory file with StringIO.
import StringIO
FFMPEG_BIN = "ffmpeg.exe"
some_fs = gridfs.GridFS(db, "some.col")
vid_id = ObjectId("5339e3b5b322631b544b2338")
vid_file = some_fs.get(vid_id)
# Should be a proper file-like object
infile = StringIO.StringIO(vid_file.read())
pipe = sp.Popen([FFMPEG_BIN,
# "-v", "quiet",
"-y",
"-i", "-",
"-vcodec", "copy", "-acodec", "copy",
"-ss", "00:00:00", "-t", "00:00:10", "-sn",
"test.mp4" ]
,stdin=infile, stdout=sp.PIPE
)
pipe.wait()
...
infile.close()