Skip to content Skip to sidebar Skip to footer

How To Use Content_type, Video/mp2t In Http Response?

I am preparing response to a http request to send video and receiving error: Broken Pipe if self.path.endswith('.ts'): f = open('filename.ts', 'r') self.send_response

Solution 1:

Alright, I'll give it a try. "Broken pipe" on the server side usually means that the client closes the connection while the server is still sending data. From your previous question, I assume your client is a browser (using the <video> tag). That most probably means that the browser does not support playback of MPEG transport streams. Actually I haven't heard of any browser that supports it.

Maybe you should try to stream an Ogg Theora video (MIME type "video/theora") for testing - Firefox 3.1+ supports this out of the box. If that works, your server implementation is correct.

Solution 2:

In the context of mpeg2ts, client(Quicktime in Browser) requesting specific byte ranges in multiple GET requests. preparing the response as per the requested byte ranges fixed the issue.

Post a Comment for "How To Use Content_type, Video/mp2t In Http Response?"