我正在尝试在我的应用程序中设置 QVideoWidget,但我没有收到音频/视频。这就是我创建相关对象的方式:
m_player = new QMediaPlayer;
m_playlist = new QMediaPlaylist(m_player);
m_playlist->addMedia(QUrl::fromLocalFile("/home/username/Documents/test.mp4"));
m_widgetVideo = new QVideoWidget;
m_player->setVideoOutput(m_widgetVideo);
m_layout = new QHBoxLayout(this);
m_layout->addWidget(m_widgetVideo);
this->setLayout(m_layout);
m_playlist->setCurrentIndex(0);
m_player->play();
我得到的只是黑屏,没有音频也没有视频。我不知道我是否可以在此处发布 MP4 文件(这是从 YouTube 下载的测试文件),所以如果有人需要有关它的信息,请问我,我会得到它。这是在测试文件上运行 ffprobe 的结果:http: //pastebin.com/xpMYbApY
QMediaPlayer->duration(); = -1
QMediaPlayer->supportedMimeTypes(); = ()
QMediaPlayer->errorString() = ""
另外,我有这些 gstreamer 包:
gstreamer0.10-alsa
gstreamer0.10-ffmpeg
gstreamer0.10-nice
gstreamer0.10-plugins-bad
gstreamer0.10-plugins-bad-multiverse
gstreamer0.10-plugins-base
gstreamer0.10-plugins-base-apps
gstreamer0.10-plugins-good
gstreamer0.10-plugins-ugly
gstreamer0.10-pulseaudio
gstreamer0.10-tools
gstreamer0.10-x
gst-launch-0.10完美播放文件,这是否意味着Qt实际上找不到安装的GStreamer编解码器?