Results 1 to 12 of 12

Thread: To make audio and video file player in Qt

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default To make audio and video file player in Qt

    Hi all

    Working on Qt4.2 on my Intel MAC machine.

    Working on a project in which I have to preview Audio and Video files.

    I am having a list of audio and video files in a tree, when I click on an audio file the song should play and when I click on any viddeo file , video should display.

    I dont have any Idea about this from where should I start making a audio and video player.

    Thanx
    merry
    Always Believe in Urself
    Merry

  2. #2
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: To make audio and video file player in Qt

    Hi,
    See QMovie - i've never used it but it may be good start. Probably you'll have to provide an imageReader plugin to support some formats encoding(see QMovie::supportedFormats() but i think there's no typical Video formats bu default rather animatable images such as gif).

    There's also QSound class that should fit your requierments - it supports only WAVE except on MAC (manual says: NSSound is used. All formats that NSSound supports, including QuickTime formats, are supported by Qt/Mac.).
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: To make audio and video file player in Qt

    In Qt 4.4 you will have a new multimedia framework called Phonon.

    More info:
    J-P Nurmi

  4. #4
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: To make audio and video file player in Qt

    Take a look of this link;
    http://www.qtcentre.org/forum/f-qt-p...post60619.html
    Also, You can play this using with MPlayer or Media Player and use of QProcess.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  5. #5
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: To make audio and video file player in Qt

    Thanx 4 all the replies

    In Qt 4.4 you will have a new multimedia framework called Phonon.
    I am working on Qt4.2

    but QMovie class supports only image formats not video formats, I want to play Video files like .AVI , .WMV etc
    Always Believe in Urself
    Merry

  6. #6
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: To make audio and video file player in Qt

    Quote Originally Posted by merry View Post
    Thanx 4 all the replies



    I am working on Qt4.2

    but QMovie class supports only image formats not video formats, I want to play Video files like .AVI , .WMV etc
    Dear Merry!
    By the use of QProcess & MPlayer you can play audio/video (with control) of WAV and WMV file easily. I have played all the movie formats using above. See the suggestion in a concious manner before replying.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  7. #7
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: To make audio and video file player in Qt

    Thanks 4 the reply Anurag

    I havent use these functions before, can I use this directly

    Qt Code:
    1. QProcess *mp=new QProcess(0);
    2.  
    3. connect(mp, SIGNAL(finished(int)),this,SLOT(endPlayProcess()));
    4.  
    5. QString program = "mplayer";
    6. QStringList arguments;
    7. QString windowId=QString::number(winId());
    8. QString ratio="";
    9. ratio+="-monitoraspect "+QString::number(4)+":"+QString::number(3)+" ";
    10. arguments<<"-vo"<<"gl2" <<"-wid" << windowId << "-slave" <<mediaPath[currentIndex] << "n";
    11. mp->start(program,arguments);
    To copy to clipboard, switch view to plain text mode 

    regards
    merry
    Always Believe in Urself
    Merry

  8. #8
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: To make audio and video file player in Qt

    Qt Code:
    1. I havent use these functions before, can I use this directly
    To copy to clipboard, switch view to plain text mode 
    first you must install the MPlayer or Media Player (if it's not exist in your system). After that you can use it. In MPlayer there is many control switches which can help you for controlling the audio & video. For thanking you can use thanks push button; a fast mechanism of Qt
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  9. The following user says thank you to ashukla for this useful post:

    merry (23rd January 2008)

  10. #9
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: To make audio and video file player in Qt

    Thanks 4 reply

    "Media Player" is not in my system, But i had to make a software in which when a user clicks on the file(Audio/Video) in a QTreeWidget , then that item should be played.

    If i use media player for this , then the file always play in this player , but if media player is not installed in users system, then the file will not play. Isnt it.

    So i want to make my own Audio/Video player.

    Regards
    merry
    Always Believe in Urself
    Merry

  11. #10
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: To make audio and video file player in Qt

    If i use media player for this , then the file always play in this player , but if media player is not installed in users system, then the file will not play. Isnt it.
    No, By the use of WindowId you can embedd any application in your widget. MPlayer provides its WindowId; but I cannot say more about Windows Media Player.

    And the second way is that in QtWindows you can use ActiveQt Framework for embedding any application. Unfortunately, it is not available in X11 platform.
    So i want to make my own Audio/Video player.
    And It is very tough to make your own player because you must access different movies formats & play it. It is a work of 3 to 5 months of devoted multimedia programmer for only one format. I am working for SWF file format and facing the many problems.
    Last edited by jpn; 23rd January 2008 at 12:22. Reason: changed [code] to [quote]
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  12. #11
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: To make audio and video file player in Qt

    Hi

    No, By the use of WindowId you can embedd any application in your widget. MPlayer provides its WindowId; but I cannot say more about Windows Media Player.
    By the use of WindowId , i had embedded "QuickTime Player", its working , but number of times i play files , the number of times ,"Different QuickTime Player" opens ,

    for every file there is a application

    I want , when i stop the process, the application should also "Quit"., but dont hnow how to do that.

    regards
    merry
    Always Believe in Urself
    Merry

  13. #12
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: To make audio and video file player in Qt

    Quote Originally Posted by merry View Post
    Hi



    By the use of WindowId , i had embedded "QuickTime Player", its working , but number of times i play files , the number of times ,"Different QuickTime Player" opens ,

    for every file there is a application

    I want , when i stop the process, the application should also "Quit"., but dont hnow how to do that.

    regards
    merry
    You should use a signal slot mechanism for stoping the process and replaying for it. It is a tricky game for playing movie. Make some effort for that.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

Similar Threads

  1. [SOLVED] DirectShow Video Player Inside Qt
    By ToddAtWSU in forum Qt Programming
    Replies: 16
    Last Post: 3rd November 2011, 08:47

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.