Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

NEW: Kdenlive can now create screencasts.

You can capture video through firewire (with dvgrab), video4linux (with ffmpeg) and x11 video grabbing (with ffmpeg configured with: --enable-x11grab )

svn path=/branches/KDE4/; revision=2276
parent 79a2a7e1
......@@ -115,6 +115,7 @@ set(kdenlive_SRCS
guide.cpp
editguidecommand.cpp
statusbarmessagelabel.cpp
regiongrabber.cpp
)
kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc )
......
......@@ -37,6 +37,7 @@
#include "mainwindow.h"
KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoProfile profile, QUndoGroup *undoGroup, MainWindow *parent): QObject(parent), m_render(NULL), m_url(url), m_projectFolder(projectFolder), m_profile(profile), m_fps((double)profile.frame_rate_num / profile.frame_rate_den), m_width(profile.width), m_height(profile.height), m_commandStack(new KUndoStack(undoGroup)), m_modified(false), m_documentLoadingProgress(0), m_documentLoadingStep(0.0), m_startPos(0) {
kDebug()<<"// init profile, ratnum: "<<profile.frame_rate_num<<", "<<profile.frame_rate_num<<", width: "<<profile.width;
m_clipManager = new ClipManager(this);
if (!url.isEmpty()) {
QString tmpFile;
......@@ -195,7 +196,7 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoPro
westley.appendChild(tractor);
}
m_scenelist = m_document.toString();
// kDebug() << "scenelist" << m_scenelist;
kDebug() << "KDEnnlive document, init timecode: "<<m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
else m_timecode.setFormat((int) m_fps);
}
......@@ -366,6 +367,7 @@ void KdenliveDoc::setProfilePath(QString path) {
m_fps = (double) m_profile.frame_rate_num / m_profile.frame_rate_den;
m_width = m_profile.width;
m_height = m_profile.height;
kDebug() << "KDEnnlive document, init timecode from path: "<<path<<", "<<m_fps;
if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
else m_timecode.setFormat((int) m_fps);
}
......
......@@ -125,6 +125,26 @@
<default></default>
</entry>
<entry name="screengrabcapture" type="String">
<label>ffmpeg arguments for x11 grab capture.</label>
<default>-f x11grab -r 15 -s %size -i :0.0%offset</default>
</entry>
<entry name="screengrabencoding" type="String">
<label>ffmpeg arguments for x11 capture encoding.</label>
<default>-vcodec mpeg4</default>
</entry>
<entry name="screengrabextension" type="String">
<label>file extension for captured file.</label>
<default>avi</default>
</entry>
<entry name="fullscreengrab" type="Bool">
<label>Capture full screen.</label>
<default>false</default>
</entry>
<entry name="video4playback" type="String">
<label>ffplay arguments for video playback.</label>
<default></default>
......
......@@ -57,6 +57,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
QWidget *p4 = new QWidget;
m_configCapture.setupUi(p4);
page4 = addPage(p4, i18n("Capture"), "audio-card");
m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
QWidget *p5 = new QWidget;
m_configShuttle.setupUi(p5);
......
......@@ -630,7 +630,9 @@ void MainWindow::newFile() {
projectFolder = w->selectedFolder();
delete w;
}
MltVideoProfile prof = ProfilesDialog::getVideoProfile(profileName);
MltVideoProfile prof;
if (!profileName.isEmpty()) prof = ProfilesDialog::getVideoProfile(profileName);
else prof = ProfilesDialog::getVideoProfile("dv_pal");
if (prof.width == 0) prof = ProfilesDialog::getVideoProfile("dv_pal");
KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, prof, m_commandStack, this);
TrackView *trackView = new TrackView(doc, this);
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
#include "ui_recmonitor_ui.h"
#include "smallruler.h"
#include "regiongrabber.h"
class RecMonitor : public QWidget {
Q_OBJECT
......@@ -40,6 +41,7 @@ public:
RecMonitor(QString name, QWidget *parent = 0);
QString name() const;
enum CAPTUREDEVICE {FIREWIRE = 0, VIDEO4LINUX = 1, SCREENGRAB =2};
protected:
virtual void mousePressEvent(QMouseEvent * event);
......@@ -48,7 +50,7 @@ private:
Ui::RecMonitor_UI ui;
QString m_tmpFolder;
QString m_name;
RegionGrabber *rgnGrab;
bool m_isActive;
......@@ -79,6 +81,7 @@ private slots:
void slotRewind();
void slotForward();
void slotDisconnect();
void slotStartGrab(const QRect &rect);
public slots:
void refreshRecMonitor(bool visible);
......
This diff is collapsed.
/*
* Copyright (C) 2007 Luca Gugelmann <lucag@student.ethz.ch>
* Adapted for Kdenlive by Jean-Baptiste Mardelle (2008) jb@kdenlive.org
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Library General Public License version 2 as
* published by the Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef REGIONGRABBER_H
#define REGIONGRABBER_H
#include <QWidget>
#include <QRegion>
#include <QPoint>
#include <QVector>
#include <QRect>
#include <QTimer>
class QPaintEvent;
class QResizeEvent;
class QMouseEvent;
class RegionGrabber : public QWidget
{
Q_OBJECT
public:
RegionGrabber();
~RegionGrabber();
protected slots:
void init();
void displayHelp();
signals:
void regionGrabbed( const QRect & );
protected:
void paintEvent( QPaintEvent* e );
void resizeEvent( QResizeEvent* e );
void mousePressEvent( QMouseEvent* e );
void mouseMoveEvent( QMouseEvent* e );
void mouseReleaseEvent( QMouseEvent* e );
void mouseDoubleClickEvent( QMouseEvent* );
void keyPressEvent( QKeyEvent* e );
void updateHandles();
QRegion handleMask() const;
QPoint limitPointToRect( const QPoint &p, const QRect &r ) const;
void grabRect();
QRect selection;
bool mouseDown;
bool newSelection;
const int handleSize;
QRect* mouseOverHandle;
QPoint dragStartPoint;
QRect selectionBeforeDrag;
QTimer idleTimer;
bool showHelp;
bool grabbing;
// naming convention for handles
// T top, B bottom, R Right, L left
// 2 letters: a corner
// 1 letter: the handle on the middle of the corresponding side
QRect TLHandle, TRHandle, BLHandle, BRHandle;
QRect LHandle, THandle, RHandle, BHandle;
QVector<QRect*> handles;
QPixmap pixmap;
};
#endif
......@@ -29,6 +29,11 @@
<string>Video4Linux (webcam)</string>
</property>
</item>
<item>
<property name="text" >
<string>Screen Grab</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0" colspan="2" >
......@@ -47,8 +52,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>233</height>
<width>486</width>
<height>270</height>
</rect>
</property>
<attribute name="title" >
......@@ -119,8 +124,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>233</height>
<width>486</width>
<height>270</height>
</rect>
</property>
<attribute name="title" >
......@@ -346,31 +351,103 @@
</widget>
</item>
</layout>
<zorder>kcfg_video4vdevice</zorder>
<zorder>label_7</zorder>
<zorder>line</zorder>
<zorder>label_3</zorder>
<zorder>label_5</zorder>
<zorder>kcfg_video4vformat</zorder>
<zorder>kcfg_video4vencoding</zorder>
<zorder>label_14</zorder>
<zorder>kcfg_video4aencoding</zorder>
<zorder>kcfg_video4adevice</zorder>
<zorder>line_2</zorder>
<zorder>label_9</zorder>
<zorder>label_16</zorder>
<zorder>label_15</zorder>
<zorder>label_13</zorder>
<zorder>line_3</zorder>
<zorder>label_4</zorder>
<zorder>label_6</zorder>
<zorder>kcfg_video4size</zorder>
<zorder>label_11</zorder>
<zorder>kcfg_video4rate</zorder>
<zorder>kcfg_video4capture</zorder>
<zorder>kcfg_video4playback</zorder>
<zorder>label_12</zorder>
<zorder>kcfg_video4aformat</zorder>
</widget>
<widget class="QWidget" name="tab_3" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>486</width>
<height>270</height>
</rect>
</property>
<attribute name="title" >
<string>Screen Grab / FFmpeg</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4" >
<item row="0" column="0" >
<widget class="QLabel" name="label_17" >
<property name="text" >
<string>Capture params</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="KLineEdit" name="kcfg_screengrabcapture" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_8" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Encoding parameters</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="KLineEdit" name="kcfg_screengrabencoding" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_10" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>File extension</string>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="KLineEdit" name="kcfg_screengrabextension" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string/>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2" >
<widget class="QCheckBox" name="kcfg_fullscreengrab" >
<property name="text" >
<string>Full screen capture</string>
</property>
</widget>
</item>
<item row="4" column="1" >
<spacer name="verticalSpacer_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>383</width>
<height>160</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
......
......@@ -64,6 +64,11 @@
<string>Video4Linux</string>
</property>
</item>
<item>
<property name="text" >
<string>Screen grab</string>
</property>
</item>
</widget>
</item>
</layout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment