Results 1 to 10 of 10

Thread: Video streaming

Threaded View

Previous Post Previous Post   Next Post Next Post
  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.

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
  •  
Qt is a trademark of The Qt Company.