×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    3

    Extracting video sequences into a new file

    Hello,

    I am trying to make a video/music player which let the user extract small sequences into a new file. First I am trying to understand how qt mutimedia works and how I could extract small sequences into a new file.
    For instance I have a video inVideo.mp3 that last 200 secondes.
    I want to extract the following intervals [4,10], [12,32] and [150,171] into a new video outVideo.mp2.
    Anyeone know how I could do that?
    Right now I tried that:
    Here is my MainWindow.cpp.

    Code:
    #include "MainWindow.h"
    #include "ui_MainWindow.h"
    #include <iostream>
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        this->ui->setupUi(this);
    
        QUrl urlInFile = QUrl::fromLocalFile("/home/cedric/VEG849.wmv");
    
    
        this->playlist.addMedia(urlInFile);
        this->player.setPlaylist(&playlist);
    
        this->recorder = new QMediaRecorder(&player);
        QVideoEncoderSettings videoEncoderSettings;
        QAudioEncoderSettings audioEncoderSettings;
    
        videoEncoderSettings.setCodec("video/mpeg2");
        videoEncoderSettings.setResolution(640, 480);
        audioEncoderSettings.setCodec("audio/vorbis");
        audioEncoderSettings.setQuality(QtMultimediaKit::HighQuality);
        this->recorder->setEncodingSettings(audioEncoderSettings, videoEncoderSettings);
    
        QUrl urlOutFile = QUrl::fromLocalFile("/home/cedric/cuttedVideo.mp2");
        this->recorder->setOutputLocation(urlOutFile);
    
        this->connect(this->ui->startButton, SIGNAL(clicked()), this, SLOT(start()));
        this->connect(this->ui->stopButton, SIGNAL(clicked()), this, SLOT(stop()));
        //*/
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
        delete this->recorder;
    }
    
    void MainWindow::start()
    {
        recorder->record();
        player.play();
        std::cout << "start" << std::endl;
        //player.setPosition(2000);
    }
    
    void MainWindow::stop()
    {
        player.stop();
        recorder->stop();
        std::cout << "stop" << std::endl;
    }
    I considere the other files not important but you can find them there:
    http://code.google.com/p/testqtmobil...k%2F04cutAudio
    The problem with that code is that the movie is playing and I can heard the sound. Also no new file is created.

    Thanks in advance,

    Cédric

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Extracting video sequences into a new file

    Hi

    According to the documentation setOutputLocation will work with QRadioTuner or QAudioCaptureSource. QMediaPlayer seems does not support recording
    check this quite fresh discussion thread they came to the conclusion to use Qt Phonon wrapper over Gstreamer. Phonon library was used in Qt before QMobility. Not sure but the both provide different API from the same backend.

    Regards,
    Igor

Similar Threads

  1. Extracting ZIP file in J2ME
    By saisrinivas27 in forum Mobile Java General
    Replies: 11
    Last Post: 2014-03-12, 06:38
  2. Extracting frame from video clip
    By liudong4u in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2010-09-21, 03:00
  3. extracting midlet jar file
    By sumanbera in forum Mobile Java General
    Replies: 20
    Last Post: 2007-09-29, 08:34
  4. Extracting/Re-Packaging a JAR file
    By thatch8 in forum Mobile Java General
    Replies: 0
    Last Post: 2007-06-12, 13:04
  5. Extracting Video from 3650 created videos
    By bobdabilder in forum Symbian
    Replies: 1
    Last Post: 2003-03-23, 02:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×