Я использую https://wiki.qt.io/RaspberryPi2EGLFS для кросс-компиляции qt5.7 qtwebengine на raspberry pi2(raspbian-jessie) и попробуйте использовать qtwebengine/examples/webenginewidgets/demobrowser и simplebrowser для воспроизведения тег видео HTML5
Однако есть две основные проблемы:
Во-первых, для видео нет звука, вы можете увидеть аналогичный вопрос qtwebengine нет звука во встроенном Linux, видео воспроизводится, но нет звука.
Во-вторых, видео лагает, я полагал, что оно не имеет аппаратного ускорения, потому что когда я запускаю программу, она выводит следующее сообщение:
/simplebrowser
ble to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
[0803/134150:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See ttps://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on.
[0803/134150:ERROR:surface_factory_qt.cpp(68)] Failed to load /opt/vc/lib/libGLESv2.so.2: /opt/vc/lib/libGLESv2.so.2: cannot open shared object file: No such file or directory
[0803/134150:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134150:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134150:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134150:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134150:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134150:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134150:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134150:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134150:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
[0803/134153:ERROR:gl_surface_qt.cpp(414)] Trying to create surface with invalid display.
[0803/134153:ERROR:command_buffer_proxy_impl.cc(201)] Failed to initialize command buffer service.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(210)] CommandBufferProxy::Initialize failed.
[0803/134153:ERROR:webgraphicscontext3d_command_buffer_impl.cc(229)] Failed to initialize command buffer.
js: Refused to set unsafe header "User-Agent"
js: Refused to set unsafe header "User-Agent"
js: Refused to set unsafe header "User-Agent"
Я думаю, что не удалось загрузить libGLESv2.so.2, поэтому аппаратное ускорение отключено.
Есть ли у кого-нибудь идеи или опыт по этому поводу?
Большое спасибо.