PDA

View Full Version : problem in media duration while stream is played through QTgstreamer player



vaibhav@wowvision.in
15th October 2015, 07:31
Hi,

I am working QT gstreamer player. I have played media coming on tcpserversrc through qtgstreamer player on ubuntu 14.04 LTS but when i query the media duration from qtgstreamer, i get the wrong value. I used following launch line to receive media and give it to sink:

QString pipe1Descr = QString("tcpserversrc host=x.x.x.x port=3000 ! "
"decodebin name=demux demux. ! "
"autoaudiosink demux. !"
"queue2 !"
"imxipuvideotransform !"
"imxeglvivsink force-aspect-ratio=false async=false");
m_pipeline = QGst::Parse::launch(pipe1Descr).dynamicCast<QGst::Pipeline>();

But when i query duration with following code then it gives wrong duration:
QGst:: DurationQueryPtr query = QGst:: DurationQuery::create(QGst::FormatTime);
m_pipeline->query(query);
return QGst::ClockTime(query->duration()).toTime();

I am sending video from tcpclientsink with following launchline:
pipeline = gst_parse_launch("filesrc location=E:/video/BismillahSalim.mp4 ! tcpclientsink host=x.x.x.x port=3000", &error);

What can i do to get correct media duration from qtgstreamer?