1
votes

I have a simple Qt application that launches a window with a QWebView. I tried several sites using the video tag with h.264, and it either can't play the video at all (as in youtube or sublime video), or it renders the video poorly, with black lines covering parts of it, like when viewing the video here.

Is this a known issue with QtWebKit, or have I neglected to do something that would make it work better? My code is below.

#include <QtGui/QApplication>
#include <QWebView>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QWebView *view = new QWebView();
    view->load(QUrl("http://webkit.org/blog/140/html5-media-support/"));
    view->show();

    return a.exec();
}
4
Maybe it's not the good idea, to use QWebView for watching videos?mosg
I want to use it to run a web application that includes use of the video tag. Why shouldn't it be able to? Does it use an older version of webkit?user123003
Are you building a 64-bit app? I'm hitting the same kind of problems here. I can play in a 32-bit app (with Qt 4.7.2) but not a 64-bit one. It appears that the H264 codec is only available as a 32-bit one on my system. I've had the same problems on mac, too.the_mandrill

4 Answers

2
votes

What platform are you on and what codecs are you using, I believe qt uses a thin layer over the system codecs DirectShow/Quicktime/Gstreamer or possibly xine/vlc if configured that way. Maybe you have bad codecs, see whether you can view h264 videos with your system codecs.

0
votes

HTML5 is currently under development as the next major revision of the HTML standard. h.264 has not been considered as a required default codec. If you want use h264 try to build latest sources webkit for Qt.

0
votes

QtWebKit delegates the media handling to Phonon. Check first if the stream can be played with the included Media Player example (see Qt Demo application). If you can't play it there, QtWebKit can't do anything.