Ejemplo n.º 1
0
STDMETHODIMP_(SIZE) ISubPicAllocatorPresenterImpl::GetVideoSize(bool fCorrectAR)
{
	CSize VideoSize(m_NativeVideoSize);

	if(fCorrectAR && m_AspectRatio.cx > 0 && m_AspectRatio.cy > 0)
		VideoSize.cx = VideoSize.cy*m_AspectRatio.cx/m_AspectRatio.cy;

	return(VideoSize);
}
STDMETHODIMP_(SIZE) CSubPicAllocatorPresenterImpl::GetVideoSize(bool fCorrectAR)
{
	CSize VideoSize(GetVisibleVideoSize());

	if(fCorrectAR && m_AspectRatio.cx > 0 && m_AspectRatio.cy > 0) {
		VideoSize.cx = (LONGLONG(VideoSize.cy)*LONGLONG(m_AspectRatio.cx))/LONGLONG(m_AspectRatio.cy);
	}

	return(VideoSize);
}
Ejemplo n.º 3
0
VideoSettings::~VideoSettings()
{
    if ( fSettings )
    {
        // we are the default settings
        // and write our settings to disk
        if (fSettings->ReplaceInt32( "video size", VideoSize() ) != B_OK)
            fSettings->AddInt32( "video size", VideoSize() );
        if (fSettings->ReplaceInt32( "flags", Flags() ) != B_OK)
            fSettings->AddInt32( "flags", Flags() );

        save_settings( fSettings, "video_settings", "VideoLAN Client" );
        delete fSettings;
    }
    else
    {
        // we are just a clone of the default settings
        fDefaultSettings.SetVideoSize( VideoSize() );
        fDefaultSettings.SetFlags( Flags() );
    }
}
Ejemplo n.º 4
0
void TimeLapseWidget::makeMovie() {
    QString picture_dir = saveDirectory->text();
    static QMap<VideoSize, QString> sizeArgs;
    if (sizeArgs.size()==0) {
        sizeArgs[Small] = tr("640x480");
        sizeArgs[Medium] = tr("1024x768");
        sizeArgs[Large] = tr("1280x1024");
    }

    try {

        QProcess *ffmpeg = new QProcess(this);
        QStringList args;
        
        args << tr("-y")
             << tr("-r") << frame_rate->text()
             << tr("-b") <<  bit_rate->text()
             << tr("-i") << tr("IMG_%04d.JPG")
             << tr("-vcodec") << codecLookup[codec->currentText()];

        if (video_size->currentText()!=tr("Original")) {
            args << tr("-s") << sizeArgs[VideoSize(video_size->currentIndex())];
        }
        args << file_name->text();
        ffmpeg->setWorkingDirectory(picture_dir);

        emit statusUpdate(tr("Encoding...") );

        connect(ffmpeg, SIGNAL(finished(int, QProcess::ExitStatus)),
                this, SLOT(movieDone(int, QProcess::ExitStatus)));
        connect(ffmpeg, SIGNAL(error(QProcess::ProcessError)),
                this, SLOT(movieError(QProcess::ProcessError)));
        ffmpeg->start("ffmpeg", args, QIODevice::ReadOnly);


    } catch (std::runtime_error re) {
        emit statusUpdate(tr("An error occured while running ffmpeg") );
        return;
    }
}