Flask 可以在javafx内部的webview中播放多部分/x-mixed-replace流吗?
我正在使用flask服务器将视频从网络摄像头传输到java客户端以下是flask实现:Flask 可以在javafx内部的webview中播放多部分/x-mixed-replace流吗?,flask,javafx,video-streaming,javafx-webview,Flask,Javafx,Video Streaming,Javafx Webview,我正在使用flask服务器将视频从网络摄像头传输到java客户端以下是flask实现: def generate(): # grab global references to the output frame and lock variables global outputFrame, lock # loop over frames from the output stream while True: # wait until the lock
def generate():
# grab global references to the output frame and lock variables
global outputFrame, lock
# loop over frames from the output stream
while True:
# wait until the lock is acquired
with lock:
# check if the output frame is available, otherwise skip
# the iteration of the loop
if outputFrame is None:
continue
# encode the frame in JPEG format
(flag, encodedImage) = cv2.imencode(".jpg", outputFrame)
# ensure the frame was successfully encoded
if not flag:
continue
# yield the output frame in the byte format
yield(b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' +
bytearray(encodedImage) + b'\r\n')
@app.route("/video_feed")
def video_feed():
# return the response generated along with the specific media
# type (mime type)
return Response(generate(),
mimetype = "multipart/x-mixed-replace; boundary=frame")
我有一个JavaFXWebView屏幕,但它没有显示任何内容。是因为Webview不支持多部分/x-mixed-replace吗?解决这个问题的办法是什么?有没有其他方法可以将python视频流放到JavaFX应用程序上?找到响应了吗?我试着在react中播放x-mixed-replacenative@ArnoldMapps:没有,我没有收到任何回复。谢谢你伸出援手。我不得不把自己当作一个网页。我是否能够嵌入JavaFX应用程序?我正在使用react native。现在,我已经添加了一个显示视频的web视图,但我想要一个最好的解决方案,将raspberry pi摄像头显示到我的屏幕上smartphone@ArnoldMapps:我也需要一个高性能的解决方案。如果你发现类似的东西,一定要分享。非常感谢。谢谢。你找到回应了吗?我试着在react中播放x-mixed-replacenative@ArnoldMapps:没有,我没有收到任何回复。谢谢你伸出援手。我不得不把自己当作一个网页。我是否能够嵌入JavaFX应用程序?我正在使用react native。现在,我已经添加了一个显示视频的web视图,但我想要一个最好的解决方案,将raspberry pi摄像头显示到我的屏幕上smartphone@ArnoldMapps:我也需要一个高性能的解决方案。如果你发现类似的东西,一定要分享。非常感谢。谢谢