我正在尝试运行带有MSYS2环境(mingw-w64)和CMake的here的Qt5视频小部件示例。一切正常构建和编译,视频播放器显示并允许我选择视频。但是,当我点击播放时,没有视频显示,也没有错误提示。视频文件没有损坏,因为我可以用VLC打开它。
CMakeLists.txt
cmake_minimum_required(VERSION 3.12)
project(VideoWidgetExample)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Multimedia REQUIRED)
find_package(Qt5MultimediaWidgets REQUIRED)
add_executable(VideoWidgetExample
VideoPlayer.cpp
VideoPlayer.h
main.cpp
)
target_link_libraries(VideoWidgetExample
Qt5::Core
Qt5::Widgets
Qt5::Gui
Qt5::Multimedia
Qt5::MultimediaWidgets
)