Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
141 views
in Technique[技术] by (71.8m points)

python - django:how to show StreamingHttpRespomse as a video?

My django project returns an HttpStreamingRespons that contains frames of a video:

views.py

@condition(etag_func=None)
def broadcast(request):
    global current_user_cam
    cc = current_vudeo.update()
    print(type(cc))
    resp = HttpResponse(cc)
    return render(rtsp)

current_video.update()

def update():
    while True:
        yield(b'--frame
' b'Content-Type: image/jpeg

' +
            bytearray(self.frame) + b'
')    

The response is generating, but how can I post this generated result in an HTML template ?

question from:https://stackoverflow.com/questions/65916675/djangohow-to-show-streaminghttprespomse-as-a-video

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...