Results 1 to 10 of 10

Thread: Video streaming

  1. #1
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Video streaming

    Hi,
    I have made an app that can play video from local and remote server(Streaming)
    I tested the code on Linux (Ubuntu) and its working perfect.
    But its not playing on Windows. I can only hear the audio can not see the video.
    Here is the code below is used
    Video from local drive
    Qt Code:
    1. void HelloMeego::on_pushButton_4_clicked()
    2. {
    3. //video
    4.  
    5. // display video in same window
    6. Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
    7.  
    8. // Phonon::VideoPlayer *myPlayer= new Phonon::VideoPlayer(Phonon::VideoCategory, this);
    9. Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this);
    10. Phonon::createPath(mediaObject, videoWidget);
    11. ui->verticalLayout->addWidget(videoWidget);
    12.  
    13. Phonon::AudioOutput *audioOutput =
    14. new Phonon::AudioOutput(Phonon::VideoCategory, this);
    15. Phonon::createPath(mediaObject, audioOutput);
    16. QString urlVideo ="TV.mp4";
    17. Phonon::MediaSource source = Phonon::MediaSource(urlVideo);
    18. mediaObject->setCurrentSource(source);
    19.  
    20. Phonon::SeekSlider *slider = new Phonon::SeekSlider;
    21. slider->setMediaObject(mediaObject);
    22. ui->horizontalLayout_2->addWidget(slider);
    23. slider->show();
    24.  
    25. mediaObject->play();
    26. }
    To copy to clipboard, switch view to plain text mode 
    Video from sever (streaming)
    Qt Code:
    1. void HelloMeego::on_pushButton_8_clicked()
    2. {
    3. //download video
    4.  
    5. // display video in same window
    6. Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this);
    7.  
    8. // Phonon::VideoPlayer *myPlayer= new Phonon::VideoPlayer(Phonon::VideoCategory, this);
    9. Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this);
    10. Phonon::createPath(mediaObject, videoWidget);
    11. ui->verticalLayout_2->addWidget(videoWidget);
    12.  
    13. Phonon::AudioOutput *audioOutput =
    14. new Phonon::AudioOutput(Phonon::VideoCategory, this);
    15. Phonon::createPath(mediaObject, audioOutput);
    16. // QString urlVideo ="big-buck-bunny.ogv";
    17. QString urlVideo ="http://videos.myserver.com/SpecialFeatures/low/FitIsHitWithChandanRoySanyal.flv";
    18. Phonon::MediaSource source = Phonon::MediaSource(urlVideo);
    19. mediaObject->setCurrentSource(source);
    20.  
    21. // Phonon::SeekSlider *slider = new Phonon::SeekSlider;
    22. // slider->setMediaObject(mediaObject);
    23. // ui->horizontalLayout_4->addWidget(slider);
    24. // slider->show();
    25.  
    26. mediaObject->play();
    27.  
    28. }
    To copy to clipboard, switch view to plain text mode 
    I have tested both flv & mp4 files.
    I have also followed this link http://www.qtcentre.org/threads/3491...ideo+streaming and installed ffdshow. But this time the audio even doesn't play.


    Please suggest me.


    Please suggest me.
    Last edited by somnathbanik; 3rd November 2010 at 07:59.

  2. #2
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Video streaming

    Is there any one who can help me please, I am facing this issue for a long time.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Video streaming

    Does the client system have proper codecs to display the video? Can you play the file directly with e.g. Windows Media Player?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Video streaming

    Quote Originally Posted by wysota View Post
    Does the client system have proper codecs to display the video? Can you play the file directly with e.g. Windows Media Player?
    Yes I can play the flv and mp4 file in my default Windows Media Player after I install k-Lite code, but the same files are not playing in my app.
    I checked and found that phonon supports the following media file format in windows
    Qt Code:
    1. ("application/vnd.ms-wpl", "application/x-mplayer2", "application/x-ms-wmd", "application/x-ms-wmz", "audio/aiff", "audio/basic", "audio/mid", "audio/midi", "audio/mp3", "audio/mpeg", "audio/mpegurl", "audio/mpg", "audio/wav", "audio/x-aiff", "audio/x-mid", "audio/x-midi", "audio/x-mp3", "audio/x-mpeg", "audio/x-mpegurl", "audio/x-mpg", "audio/x-ms-wax", "audio/x-ms-wma", "audio/x-wav", "midi/mid", "unknown", "video/avi", "video/mpeg", "video/mpg", "video/msvideo", "video/x-mpeg", "video/x-mpeg2a", "video/x-ms-asf", "video/x-ms-asf-plugin", "video/x-ms-wm", "video/x-ms-wmv", "video/x-ms-wmx", "video/x-ms-wvx", "video/x-msvideo")
    To copy to clipboard, switch view to plain text mode 
    Is there any possibility that I could add flv and mp4 file format in Phonon?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Video streaming

    Phonon supports everything your backend (Direct Show used also by WMP in case of Windows) supports. If WMP can play the file, Phonon should play it as well unless your codec pack somehow prevents it from it (maybe you need to enable the applications that can use the codecs in the codec pack configuration?).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Video streaming

    I tried to play mpg from my local drive, but the app hangs. Is there any issue in my code. Please help me.

    Quote Originally Posted by wysota View Post
    Phonon supports everything your backend (Direct Show used also by WMP in case of Windows) supports. If WMP can play the file, Phonon should play it as well unless your codec pack somehow prevents it from it (maybe you need to enable the applications that can use the codecs in the codec pack configuration?).
    How do I enable the app in the codec pack configuration. Do I instal k_lite or FFdshow?


    Added after 25 minutes:


    Quote Originally Posted by wysota View Post
    Phonon supports everything your backend (Direct Show used also by WMP in case of Windows) supports. If WMP can play the file, Phonon should play it as well unless your codec pack somehow prevents it from it (maybe you need to enable the applications that can use the codecs in the codec pack configuration?).
    I have reinstalled the k-Lite again , and can play the flv and mp4 files on MPC and WMP. when I play the files through my app the audio comes out not the video. where do I configure to play the video?
    I believe there is some issue, i tried to play the files through qmediaplayer example from Nokia Qt SDK, but its not playing.
    Last edited by somnathbanik; 3rd November 2010 at 11:25.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Video streaming

    Quote Originally Posted by somnathbanik View Post
    Do I instal k_lite or FFdshow?
    How should I know?

    I believe there is some issue, i tried to play the files through qmediaplayer example from Nokia Qt SDK, but its not playing.
    It probably uses the same backend so the issue is exactly the same - you are missing a codec or you have a misconfiguration issue on your system.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    somnathbanik (4th November 2010)

  9. #8
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Video streaming

    Quote Originally Posted by wysota View Post
    How should I know?


    It probably uses the same backend so the issue is exactly the same - you are missing a codec or you have a misconfiguration issue on your system.
    Could you please check my above code once so that I can make sure that its not my coding issue and will try to find a codec only.

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Video streaming

    If it works on Linux then the code is fine provided the file can be found by the player. Since you are getting audio then it is found and is being played.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. The following user says thank you to wysota for this useful post:

    somnathbanik (4th November 2010)

  12. #10
    Join Date
    Nov 2010
    Posts
    48
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Video streaming

    Quote Originally Posted by wysota View Post
    If it works on Linux then the code is fine provided the file can be found by the player. Since you are getting audio then it is found and is being played.
    Yes you are right, thank you. Let me see what I can do wtih the codec.

Similar Threads

  1. Streaming Video
    By khrave in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2010, 20:08
  2. Help in creating video streaming app
    By superutsav in forum Qt Programming
    Replies: 16
    Last Post: 21st April 2010, 15:55
  3. Video Streaming
    By stefandetter in forum Qt Programming
    Replies: 1
    Last Post: 4th June 2008, 09:59
  4. Video streaming with QT4
    By QiT in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2008, 18:09
  5. Video streaming on QMainWindow
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2008, 17:15

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.