Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
ff1fa2fd
Commit
ff1fa2fd
authored
Jul 10, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintroduce extract clip zone to cut a clip whithout re-encoding
Fixes
#237
CCBUG: 408402
parent
969c699c
Pipeline
#5132
passed with stage
in 24 minutes and 19 seconds
Changes
8
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
211 additions
and
465 deletions
+211
-465
src/jobs/CMakeLists.txt
src/jobs/CMakeLists.txt
+1
-1
src/jobs/cutclipjob.cpp
src/jobs/cutclipjob.cpp
+150
-422
src/jobs/cutclipjob.h
src/jobs/cutclipjob.h
+24
-30
src/jobs/speedjob.cpp
src/jobs/speedjob.cpp
+1
-1
src/mainwindow.cpp
src/mainwindow.cpp
+0
-3
src/monitor/monitor.cpp
src/monitor/monitor.cpp
+5
-1
src/monitor/monitor.h
src/monitor/monitor.h
+0
-2
src/ui/cutjobdialog_ui.ui
src/ui/cutjobdialog_ui.ui
+30
-5
No files found.
src/jobs/CMakeLists.txt
View file @
ff1fa2fd
...
...
@@ -10,7 +10,7 @@ set(kdenlive_SRCS
jobs/stabilizejob.cpp
jobs/thumbjob.cpp
jobs/transcodeclipjob.cpp
#
jobs/cutclipjob.cpp
jobs/cutclipjob.cpp
jobs/filterclipjob.cpp
jobs/proxyclipjob.cpp
PARENT_SCOPE
)
src/jobs/cutclipjob.cpp
View file @
ff1fa2fd
This diff is collapsed.
Click to expand it.
src/jobs/cutclipjob.h
View file @
ff1fa2fd
...
...
@@ -23,51 +23,45 @@
#include "abstractclipjob.h"
class
ProjectClip
;
/**
* @class CutClipJob
* @brief This job class will either transcode or render a part of a clip through FFmpeg or LibAV
*
*/
class
JobManager
;
class
CutClipJob
:
public
AbstractClipJob
{
Q_OBJECT
public:
/** @brief Creates the Job.
* @param cType the Clip Type (AV, PLAYLIST, AUDIO, ...) as defined in definitions.h. Some jobs will act differently depending on clip type
* @param id the id of the clip that requested this clip job
* @param parameters StringList that should contain: destination file << source file << in point (optional) << out point (optional)
* */
CutClipJob
(
ClipType
cType
,
const
QString
&
id
,
const
QStringList
&
parameters
);
virtual
~
CutClipJob
();
const
QString
destination
()
const
override
;
void
startJob
()
override
;
stringMap
cancelProperties
()
override
;
const
QString
statusMessage
()
override
;
bool
isExclusive
()
override
;
static
QHash
<
ProjectClip
*
,
AbstractClipJob
*>
prepareTranscodeJob
(
double
fps
,
const
QList
<
ProjectClip
*>
&
ids
,
const
QStringList
&
parameters
);
static
QHash
<
ProjectClip
*
,
AbstractClipJob
*>
prepareCutClipJob
(
double
fps
,
double
originalFps
,
ProjectClip
*
clip
);
static
QHash
<
ProjectClip
*
,
AbstractClipJob
*>
prepareAnalyseJob
(
double
fps
,
const
QList
<
ProjectClip
*>
&
clips
,
const
QStringList
&
parameters
);
static
QList
<
ProjectClip
*>
filterClips
(
const
QList
<
ProjectClip
*>
&
clips
,
const
QStringList
&
params
);
/** @brief Extract part of a clip with ffmpeg whithout re-encoding
*/
CutClipJob
(
const
QString
&
binId
,
const
QString
sourcePath
,
GenTime
inTime
,
GenTime
outTime
,
const
QString
destPath
,
QStringList
encodingParams
);
private:
QString
m_dest
;
QString
m_src
;
QString
m_start
;
QString
m_end
;
QString
m_cutExtraParams
;
int
m_jobDuration
;
// This is a special function that prepares the stabilize job for a given list of clips.
// Namely, it displays the required UI to configure the job and call startJob with the right set of parameters
bool
startJob
()
override
;
// Then the job is automatically put in queue. Its id is returned
static
int
prepareJob
(
const
std
::
shared_ptr
<
JobManager
>
&
ptr
,
const
std
::
vector
<
QString
>
&
binIds
,
int
parentId
,
QString
undoString
,
GenTime
inTime
,
GenTime
outTime
);
void
processLogInfo
()
override
;
void
analyseLogInfo
();
void
processAnalyseLog
();
bool
commitResult
(
Fun
&
undo
,
Fun
&
redo
)
override
;
const
QString
getDescription
()
const
override
;
signals:
/** @brief When user requested a to process an Mlt::Filter, this will send back all necessary infos. */
void
gotFilterJobResults
(
const
QString
&
id
,
int
startPos
,
int
track
,
const
stringMap
&
result
,
const
stringMap
&
extra
);
private
slots
:
void
processLogInfo
();
protected:
QString
m_sourceUrl
;
QString
m_destUrl
;
bool
m_done
;
std
::
unique_ptr
<
QProcess
>
m_jobProcess
;
GenTime
m_in
;
GenTime
m_out
;
QStringList
m_encodingParams
;
int
m_jobDuration
;
};
#endif
src/jobs/speedjob.cpp
View file @
ff1fa2fd
...
...
@@ -138,7 +138,7 @@ int SpeedJob::prepareJob(const std::shared_ptr<JobManager> &ptr, const std::vect
}
// Filter several clips, destination points to a folder
if
(
QFile
::
exists
(
mltfile
))
{
KIO
::
RenameDialog
renameDialog
(
qApp
->
activeWindow
(),
QString
(),
/*i18n("File already exists"), */
QUrl
::
fromLocalFile
(
mltfile
),
QUrl
::
fromLocalFile
(
mltfile
),
KIO
::
RenameDialog_Option
::
RenameDialog_Overwrite
);
KIO
::
RenameDialog
renameDialog
(
qApp
->
activeWindow
(),
i18n
(
"File already exists"
),
QUrl
::
fromLocalFile
(
mltfile
),
QUrl
::
fromLocalFile
(
mltfile
),
KIO
::
RenameDialog_Option
::
RenameDialog_Overwrite
);
if
(
renameDialog
.
exec
()
!=
QDialog
::
Rejected
)
{
QUrl
final
=
renameDialog
.
newDestUrl
();
if
(
final
.
isValid
())
{
...
...
src/mainwindow.cpp
View file @
ff1fa2fd
...
...
@@ -259,9 +259,6 @@ void MainWindow::init()
connect(m_projectList, SIGNAL(refreshClip(QString,bool)), pCore->monitorManager(), SLOT(slotRefreshCurrentMonitor(QString)));
connect(m_clipMonitor, SIGNAL(zoneUpdated(QPoint)), m_projectList, SLOT(slotUpdateClipCut(QPoint)));*/
// TODO refac : reimplement ?
// connect(m_clipMonitor, &Monitor::extractZone, pCore->bin(), &Bin::slotStartCutJob);
connect
(
m_clipMonitor
,
&
Monitor
::
passKeyPress
,
this
,
&
MainWindow
::
triggerKey
);
m_projectMonitor
=
new
Monitor
(
Kdenlive
::
ProjectMonitor
,
pCore
->
monitorManager
(),
this
);
...
...
src/monitor/monitor.cpp
View file @
ff1fa2fd
...
...
@@ -34,6 +34,8 @@
#include "project/projectmanager.h"
#include "qmlmanager.h"
#include "recmanager.h"
#include "jobs/jobmanager.h"
#include "jobs/cutclipjob.h"
#include "scopes/monitoraudiolevel.h"
#include "timeline2/model/snapmodel.hpp"
#include "transitions/transitionsrepository.hpp"
...
...
@@ -1005,7 +1007,9 @@ void Monitor::slotExtractCurrentZone()
if
(
m_controller
==
nullptr
)
{
return
;
}
emit
extractZone
(
m_controller
->
AbstractProjectItem
::
clipId
());
GenTime
inPoint
(
getZoneStart
(),
pCore
->
getCurrentFps
());
GenTime
outPoint
(
getZoneEnd
(),
pCore
->
getCurrentFps
());
pCore
->
jobManager
()
->
startJob
<
CutClipJob
>
({
m_controller
->
clipId
()},
-
1
,
QString
(),
inPoint
,
outPoint
);
}
std
::
shared_ptr
<
ProjectClip
>
Monitor
::
currentController
()
const
...
...
src/monitor/monitor.h
View file @
ff1fa2fd
...
...
@@ -338,8 +338,6 @@ signals:
/** @brief Editing transitions / effects over the monitor requires the renderer to send frames as QImage.
* This causes a major slowdown, so we only enable it if required */
void
requestFrameForAnalysis
(
bool
);
/** @brief Request a zone extraction (ffmpeg transcoding). */
void
extractZone
(
const
QString
&
id
);
void
effectChanged
(
const
QRect
&
);
void
effectPointsChanged
(
const
QVariantList
&
);
void
addRemoveKeyframe
();
...
...
src/ui/cutjobdialog_ui.ui
View file @
ff1fa2fd
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
387
</width>
<height>
24
0
</height>
<width>
270
</width>
<height>
24
4
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -39,15 +39,24 @@
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"destination_label"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Maximum"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Save to
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
colspan=
"3"
>
<widget
class=
"KUrlRequester"
name=
"file_url"
>
<property
name=
"mode"
>
<set>
KFile::File|KFile::LocalOnly
</set>
<widget
class=
"KUrlRequester"
name=
"file_url"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"MinimumExpanding"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
...
...
@@ -135,5 +144,21 @@
</hint>
</hints>
</connection>
<connection>
<sender>
button_more
</sender>
<signal>
toggled(bool)
</signal>
<receiver>
extra_params
</receiver>
<slot>
setVisible(bool)
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
362
</x>
<y>
24
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
193
</x>
<y>
151
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment