I want to return an mp4
from a wsgi application. I'm not using Django or other framework. The mp4
is returned by the parseParams
function:
def parseParams(params):
// cmd invokes ffmpeg, which writes output to pipe:1 (stdout)
return [ call(cmd) ]
form = "<html>...</html>"
def application(environ, start_response):
x = handle_post(environ)
if (isinstance(x, dict)):
start_response('200 OK', [('Content-Type','video/mp4')])
return parseParams(x)
else:
start_response('200 OK', [('Content-Type','text/html')])
return [form]
The logs are full of binary data, presumably the output of ffmpeg
, and nothing is returned to the browser, although I can see that the mime type header is properly set. What am I missing?