Tool/software: Linux
Hi - I am using gstreamer from the latest TISDK on my custom AM5728 Board:
root@am57xx:~# gst-inspect-1.0 --version gst-inspect-1.0 version 1.12.2 GStreamer 1.12.2 Unknown package origin root@am57xx:~# uname -r 4.4.41
I can successfully use gstreamer on the board to encode data into an H264 File with this command:
GST_DEBUG=3 gst-launch-1.0 filesrc location=/am5728-gst-tests/video-samples/airshow_p352x288.yuv ! videoparse width=352 height=288 format=nv12 ! ducatih264enc intra-interval=4 ! queue ! filesink location=/home/root/test.h264
I can then also successfully play back the H264 encoded file on my Ubuntu 16.04 machine with this command ( the resulting video looks great ):
root@build:/home/me/am57xx/build/exported-nfs/home/root# ffplay test.h264
Now, I want to use Qt5.11's QMultimedia framework ( which runs on top of GStreamer ) to play the H264 file. The entire simple test code is here:
#include <QApplication>
#include <QVideoWidget>
#include <QMediaPlayer>
#include <QGraphicsView>
#include <QtMultimedia>
#include <QGraphicsVideoItem>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsView * graphicsView = new QGraphicsView;
QMediaPlayer * player = new QMediaPlayer;
QGraphicsScene * scene = new QGraphicsScene;
graphicsView->setScene(scene);
QGraphicsVideoItem *item = new QGraphicsVideoItem;
player->setVideoOutput(item);
graphicsView->scene()->addItem(item);
graphicsView->show();
player->setMedia(QUrl::fromLocalFile("/home/root/test.h264"));
player->play();
return a.exec();
}
I run the Qt App with GST_DEBUG and QT_DEBUG_PLUGINS. It finds the gstreamer plugins, and the debugging prints show that it attempts to use the gstducatih264dec functionality. The problem is that GStreamer throws and error "Cant query buffers". Here is the error:
Got keys from plugin meta data ("gstreamermediaplayer")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/mediaservice" ...
loaded library "/usr/lib/qt5/plugins/mediaservice/libgstmediaplayer.so"
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/resourcepolicy" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/resourcepolicy" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/video/gstvideorenderer" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/video/gstvideorenderer" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/qt5/plugins/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/accessible" ...
0:00:00.311770349 1256 0x31e00 WARN oss gstosssink.c:399:gst_oss_sink_open:<audiosink-actual-sink-oss> error: Could not open audio device for playback.
0:00:00.312187101 1256 0x31e00 WARN oss gstosssink.c:399:gst_oss_sink_open:<audiosink-actual-sink-oss> error: system error: No such file or directory
0:00:00.321556701 1256 0x31e00 WARN basesrc gstbasesrc.c:3480:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.328267514 1256 0x31e00 WARN basesrc gstbasesrc.c:3480:gst_base_src_start_complete:<source> pad not activated yet
Warning: "Could not open audio device for playback."
0:00:00.634284017 1256 0xb281ae30 WARN ducati gstducatih264dec.c:415:gst_ducati_h264dec_set_sink_caps:<decoder> num-reorder-frames not found on caps, calculation from stream parameters gives 16
0:00:00.634583161 1256 0xb281ae30 WARN ducati gstducatih264dec.c:423:gst_ducati_h264dec_set_sink_caps:<decoder> Using 0 frames for reordering
0:00:00.697457081 1256 0xb281ae30 WARN ducati gstducatividdec.c:590:codec_process:<decoder> changing max-ref-frames in caps to 19
0:00:00.713963193 1256 0xb281ae30 WARN vpe gstvpebufferpool.c:471:gst_vpe_buffer_pool_import: Allocating a new input buffer index: 0/128, 0
0:00:00.714733094 1256 0xb281ae30 ERROR vpe gstvpebufferpool.c:603:gst_vpe_buffer_pool_set_streaming: Cant query buffers
0:00:00.715642401 1256 0xb281ae30 ERROR vpe gstvpebufferpool.c:603:gst_vpe_buffer_pool_set_streaming: Cant query buffers
How can I get the H264 decoding to work ? Thank you.
