Results 1 to 4 of 4

Thread: videoplayer problem in qmediaplayer

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default videoplayer problem in qmediaplayer

    This is an ex: for videoplayer using Qmediaplayer in meego netbook sdk.But this doesn't work and errors are shown


    //.pro file
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2011-08-25T14:33:25
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8. QT +=multimedia
    9.  
    10. TARGET = videoplayer
    11. CONFIG += meegotouch
    12. TEMPLATE = app
    13. target.path=/usr/local/bin
    14. INSTALLS=target
    15.  
    16.  
    17. SOURCES += main.cpp \
    18. videoplayer.cpp
    19.  
    20. HEADERS += \
    21. videoplayer.h
    22.  
    23. FORMS += \
    24. videoplayer.ui
    To copy to clipboard, switch view to plain text mode 
    //header file
    Qt Code:
    1. #ifndef VIDEOPLAYER_H
    2. #define VIDEOPLAYER_H
    3.  
    4. #include <QMainWindow>
    5. #include <QtMultimediaKit/QMediaPlayer>
    6. #include <QtMultimediaKit/QVideoWidget>
    7. #include <QUrl>
    8.  
    9. namespace Ui {
    10. class VIDEOPLAYER;
    11. }
    12.  
    13. class VIDEOPLAYER : public QMainWindow
    14. {
    15. Q_OBJECT
    16.  
    17. public:
    18. explicit VIDEOPLAYER(QWidget *parent = 0);
    19. QMediaPlayer *player ;
    20.  
    21. QVideoWidget *widget;
    22.  
    23.  
    24. /* videoWidget = new VideoWidget(this);
    25.   player->setVideoOutput(videoWidget); additional control*/
    26.  
    27.  
    28.  
    29. ~VIDEOPLAYER();
    30.  
    31. private slots:
    32. void on_pushButton_2_clicked();
    33.  
    34. void on_pushButton_clicked();
    35.  
    36. private:
    37. Ui::VIDEOPLAYER *ui;
    38. };
    39.  
    40. #endif // VIDEOPLAYER_H
    To copy to clipboard, switch view to plain text mode 
    //cpp file
    Qt Code:
    1. #include "videoplayer.h"
    2. #include "ui_videoplayer.h"
    3. #include <QtMultimediaKit/QMediaPlayer>
    4. #include <QtMultimediaKit/QVideoWidget>
    5. #include <QUrl>
    6. #include <QDebug>
    7.  
    8.  
    9.  
    10. VIDEOPLAYER::VIDEOPLAYER(QWidget *parent) :
    11. QMainWindow(parent),
    12. ui(new Ui::VIDEOPLAYER)
    13. {
    14. ui->setupUi(this);
    15. ui->pushButton_2->hide();
    16. player = new QMediaPlayer(this);
    17. player->setMedia(QUrl::fromLocalFile("test.avi"));
    18. widget = new QVideoWidget(ui->frame);
    19. widget->show();
    20.  
    21. player->setVideoOutput(widget);
    22. player->play();
    23.  
    24.  
    25.  
    26.  
    27.  
    28.  
    29.  
    30. }
    31.  
    32. VIDEOPLAYER::~VIDEOPLAYER()
    33. {
    34. delete ui;
    35.  
    36.  
    37. }
    38.  
    39. void VIDEOPLAYER::on_pushButton_2_clicked()
    40. {
    41. ui->pushButton->show();
    42. ui->pushButton_2->hide();
    43. player->pause();
    44.  
    45. }
    46.  
    47. void VIDEOPLAYER::on_pushButton_clicked()
    48. {
    49. player->play();
    50. ui->pushButton->hide();
    51. ui->pushButton_2->show();
    52.  
    53. }
    To copy to clipboard, switch view to plain text mode 


    error:
    c:/meegosdk_1.2/madde/toolchains/meego-sdk-i586-toolchain-1.1-w32_i686/meego-toolchain/bin/../lib/gcc/i586-meego-linux/4.5.0/../../../../i586-meego-linux/bin/ld.exe: cannot find -lQtMultimedia
    collect2: ld returned 1 exit status
    make: *** [videoplayer] Error 1
    The process "C:\meegosdk_1.2\madde\bin\make.exe" exited with code 2.
    Error while building project videoplayer (target: MeeGo)
    When executing build step 'Make'

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: videoplayer problem in qmediaplayer

    cannot find -lQtMultimedia
    It looks like your Qt is not configured with multimedia, the lib can't be found.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: videoplayer problem in qmediaplayer

    Can you please tell me how to configure qt for multimedia as i am really novice in this

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: videoplayer problem in qmediaplayer

    run configure -help, you will see all the options then.
    Then run configure with the options you want.
    Build.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Problem in phonon videoplayer
    By vinayaka in forum Newbie
    Replies: 1
    Last Post: 20th January 2012, 11:55
  2. Phonon VideoPlayer resize problem
    By danblack in forum Qt Programming
    Replies: 1
    Last Post: 21st August 2011, 15:24
  3. Replies: 0
    Last Post: 8th July 2011, 05:52
  4. Replies: 0
    Last Post: 8th July 2011, 05:04
  5. Replies: 1
    Last Post: 21st April 2011, 06:19

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.