: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
qputenv("GST_DEBUG", "3");
QVideoWidget* vw = new QVideoWidget(ui->widget);
vw->resize(ui->widget->size());
vw->show();
QMediaPlayer* mp = new QMediaPlayer(this);
mp->setVideoOutput(vw);
mp->setMedia(QUrl::fromLocalFile("/home/ccls/38d6.flac"));
QString pipeline = "gst-pipeline: playbin uri=file://%1 video-sink=\"xvimagesink name=qtvideosink\"";
pipeline = "gst-pipeline: videotestsrc ! xvimagesink name=\"qtvideosink\"";
// pipeline = "file://%1";
QString file("/home/ccls/fr.mp4");
mp->setMedia(QMediaContent(QUrl(pipeline.arg(file))));
mp->setVolume(50);
mp->play();
}
< /code>
В этом фрагменте кода: < /p>
- Первый конвейер с использованием Playbin не отображает видео в qvideowidget. < /p>
< /li>
QVideOwidget.
Подробнее здесь: https://stackoverflow.com/questions/797 ... in-element
Мобильная версия