PDA

View Full Version : bitrate of vedio file



bartarya.parul
15th July 2016, 14:18
hello,
I am trying to find bitrate of vedio file or vedio clip without metadata ,and i want to get bitrate of vedio in windows as well as MAC o.s.
can anyone help me to get bitrate of vedio in qt c++.

ChrisW67
15th July 2016, 21:45
If you have no metadata, i.e. No play time and bit rate per stream, then the only way I can see to determine/estimate the bitrate (without decoding the entire video stream yourself) is to play the video (entirely or at least a few minutes) and calculate the number of bits processed divided by the time. This will only be approximate because the video stream may have many audio streams and has a container overhead that cannot be disentangled easily.

bartarya.parul
18th July 2016, 11:26
ok,but i am trying to build utility application which get bitrate of vedio file.i find it (bitrate )in windows by MSDN site IPropertystore(with metadata).but i want it also in mac.
now can u help me.
thanku for sharing ur view.

ChrisW67
18th July 2016, 22:07
So in Windows you use a properties collection on some sort of multimedia object. This implies that there is metadata in the source stream (file). If there is metadata available then look at QMediaObject

You could look at cross-platform tools like libav

bartarya.parul
19th July 2016, 13:02
sorry i dont get it how to use qmediaobject .can u know some example.i spend lot of time to know how to proceed ,but dont get.
thanku for ur updation.

ChrisW67
20th July 2016, 13:00
#include <QApplication>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <QObject>

class Demo: public QVideoWidget
{
Q_OBJECT
public:
Demo(QWidget *p = Q_NULLPTR): QVideoWidget(p), player(Q_NULLPTR) {
player = new QMediaPlayer(this);
player->setVideoOutput(this);
connect(player, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(metaDataAvailableChanged(bool)));
player->setMedia(QUrl::fromLocalFile("/tmp/tt/video.mp4"));
player->setVolume(50);
player->play();
}
public slots:
void metaDataAvailableChanged(bool available) {
if (available) {
qDebug() << "Available";
foreach(QString key, player->availableMetaData()) {
qDebug() << key << player->metaData(key);
}
}
else {
qDebug() << "Not available";
}
}

private:
QMediaPlayer *player;
};

int main(int argc, char **argv) {
QApplication app(argc, argv);

Demo d;
d.show();

return app.exec();
}
#include "main.moc"

for my sample video:


"AudioBitRate" QVariant(uint, 120272)
"AudioCodec" QVariant(QString, "MPEG-4 AAC audio")
"maximum-bitrate" QVariant(uint, 144896)

bartarya.parul
20th July 2016, 14:42
thanku for ur effort.
but i heve error -DirectShowPlayerService::doRender: Unresolved error code 80040266
please help me.

player->setMedia(QUrl::fromLocalFile("C:/Users/dev/Desktop/nasa_shuttle_m420p-30 960x540.mov"));
for media path

ChrisW67
20th July 2016, 22:03
Directshow 80040266 (http://lmgtfy.com/?q=Directshow+80040266)
VFW_E_NO_TRANSPORT 0x80040266
Chances are your system has no codec for Quicktime video.

bartarya.parul
22nd July 2016, 10:45
can u suggest me,now what can i do to get bitrate of vedio file.

anda_skoa
22nd July 2016, 13:13
Install the QuickTime codec?

Cheers,
_

bartarya.parul
26th July 2016, 11:11
hello,
how to get bitrate of vedio file bitrate,framerate(fps) in mac.

anda_skoa
26th July 2016, 12:04
how to get bitrate of vedio file bitrate,framerate(fps) in mac.
The Qt code ChrisW67 posted is not platform specific.

Cheers,
_

bartarya.parul
26th July 2016, 13:29
yes u r right but i can find it in windows using windows library.
but want to find also in mac.

anda_skoa
26th July 2016, 14:35
well, if you use platform specific API on Windows and not Qt, then this isn't probably the best forum to ask on.

There will be likely macOS specific APIs as well, a macOS forum will likely have better answers,

Cheers,
_

bartarya.parul
27th July 2016, 11:24
can i use c++ library in qt for mac?

anda_skoa
27th July 2016, 11:38
Obviously, since Qt itself is a C++ library.

Cheers,
_