Results 1 to 16 of 16

Thread: bitrate of vedio file

  1. #1
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default bitrate of vedio file

    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++.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: bitrate of vedio file

    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.

  3. #3
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: bitrate of vedio file

    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.
    Last edited by bartarya.parul; 18th July 2016 at 11:30. Reason: reformatted to look better

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: bitrate of vedio file

    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

  5. #5
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: bitrate of vedio file

    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.

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: bitrate of vedio file

    Qt Code:
    1. #include <QApplication>
    2. #include <QMediaPlayer>
    3. #include <QVideoWidget>
    4. #include <QObject>
    5.  
    6. class Demo: public QVideoWidget
    7. {
    8. Q_OBJECT
    9. public:
    10. Demo(QWidget *p = Q_NULLPTR): QVideoWidget(p), player(Q_NULLPTR) {
    11. player = new QMediaPlayer(this);
    12. player->setVideoOutput(this);
    13. connect(player, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(metaDataAvailableChanged(bool)));
    14. player->setMedia(QUrl::fromLocalFile("/tmp/tt/video.mp4"));
    15. player->setVolume(50);
    16. player->play();
    17. }
    18. public slots:
    19. void metaDataAvailableChanged(bool available) {
    20. if (available) {
    21. qDebug() << "Available";
    22. foreach(QString key, player->availableMetaData()) {
    23. qDebug() << key << player->metaData(key);
    24. }
    25. }
    26. else {
    27. qDebug() << "Not available";
    28. }
    29. }
    30.  
    31. private:
    32. QMediaPlayer *player;
    33. };
    34.  
    35. int main(int argc, char **argv) {
    36. QApplication app(argc, argv);
    37.  
    38. Demo d;
    39. d.show();
    40.  
    41. return app.exec();
    42. }
    43. #include "main.moc"
    To copy to clipboard, switch view to plain text mode 
    for my sample video:
    Qt Code:
    1. "AudioBitRate" QVariant(uint, 120272)
    2. "AudioCodec" QVariant(QString, "MPEG-4 AAC audio")
    3. "maximum-bitrate" QVariant(uint, 144896)
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: bitrate of vedio file

    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

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: bitrate of vedio file

    Directshow 80040266
    VFW_E_NO_TRANSPORT 0x80040266
    Chances are your system has no codec for Quicktime video.

  9. #9
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: bitrate of vedio file

    can u suggest me,now what can i do to get bitrate of vedio file.

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bitrate of vedio file

    Install the QuickTime codec?

    Cheers,
    _

  11. #11
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default get bitrate

    hello,
    how to get bitrate of vedio file bitrate,framerate(fps) in mac.

  12. #12
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: get bitrate

    Quote Originally Posted by bartarya.parul View Post
    how to get bitrate of vedio file bitrate,framerate(fps) in mac.
    The Qt code ChrisW67 posted is not platform specific.

    Cheers,
    _

  13. #13
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: get bitrate

    yes u r right but i can find it in windows using windows library.
    but want to find also in mac.

  14. #14
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: get bitrate

    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,
    _

  15. #15
    Join Date
    Sep 2015
    Posts
    28
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: get bitrate

    can i use c++ library in qt for mac?

  16. #16
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: get bitrate

    Obviously, since Qt itself is a C++ library.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 21st February 2015, 21:01
  2. Replies: 2
    Last Post: 13th January 2014, 07:27
  3. Replies: 4
    Last Post: 2nd October 2013, 13:57
  4. Replies: 3
    Last Post: 28th March 2009, 15:37
  5. Replies: 3
    Last Post: 25th May 2007, 07:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.