使用SimpleHTTPServer的音频/视频流传输失败 [英] Audio/Video streaming fails using SimpleHTTPServer
问题描述
我通过使用python -m SimpleHTTPServer
调用服务器来将文件夹中的文件共享给其他设备.
I share files in a folder to other devices by invoking a server using python -m SimpleHTTPServer
.
我刚刚尝试使用此&串流视频/音频(标准mp4和mp3,均在20MB以下)到另一台计算机. ( WORKS )(但通过在终端中抛出错误(列出来)).
I just tried to stream videos/audio (standard mp4 & mp3, both under 20MB) to another computer using this & it WORKS (but by throwing the errors (listed down) in the terminal).
以某种方式,视频/音频(非常小的mp3文件除外)无法在iPhone/iPad中与Safari一起播放.它绝对与媒体文件无关,因为我在iPhone中使用Apache成功地对它们进行了流传输.
Somehow, the video/audio fails (except very small mp3 files) to play with Safari in iPhone/iPad. It is definitely not related to the media files, as I streamed them successfully using Apache in iPhone.
知道为什么会发生吗?
Any idea why it happens?
Exception happened during processing of request from ('192.168.1.2', 51775)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
推荐答案
As sugested either use python alternatives, What is a faster alternative to Python's http.server (or SimpleHTTPServer)? or use full blown web serwer altogether. Quick google suggests that Mac supports both Nignx and Apache2.
这篇关于使用SimpleHTTPServer的音频/视频流传输失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!