]> git.sesse.net Git - kdenlive/blob - renderer/kdenlive_render.cpp
Get ready for rendering only part of timeline
[kdenlive] / renderer / kdenlive_render.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2006-2008 Trolltech ASA. All rights reserved.
4 **
5 ** This file is part of the tools applications of the Qt Toolkit.
6 **
7 ** This file may be used under the terms of the GNU General Public
8 ** License versions 2.0 or 3.0 as published by the Free Software
9 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
10 ** included in the packaging of this file.  Alternatively you may (at
11 ** your option) use any later version of the GNU General Public
12 ** License if such license has been publicly approved by Trolltech ASA
13 ** (or its successors, if any) and the KDE Free Qt Foundation. In
14 ** addition, as a special exception, Trolltech gives you certain
15 ** additional rights. These rights are described in the Trolltech GPL
16 ** Exception version 1.2, which can be found at
17 ** http://www.trolltech.com/products/qt/gplexception/ and in the file
18 ** GPL_EXCEPTION.txt in this package.
19 **
20 ** Please review the following information to ensure GNU General
21 ** Public Licensing requirements will be met:
22 ** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
23 ** you are unsure which license is appropriate for your use, please
24 ** review the following information:
25 ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
26 ** or contact the sales department at sales@trolltech.com.
27 **
28 ** In addition, as a special exception, Trolltech, as the sole
29 ** copyright holder for Qt Designer, grants users of the Qt/Eclipse
30 ** Integration plug-in the right for the Qt/Eclipse Integration to
31 ** link to functionality provided by Qt Designer and its related
32 ** libraries.
33 **
34 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
35 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
36 ** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
37 ** granted herein.
38 **
39 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
40 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41 **
42 ****************************************************************************/
43
44 #include <stdio.h>
45 #include <QCoreApplication>
46 #include <QStringList>
47 #include <QString>
48
49 #include "renderjob.h"
50
51 int main(int argc, char **argv) {
52     QCoreApplication app(argc, argv);
53     QStringList args = app.arguments();
54     int in = -1;
55     int out = -1;
56     if (!args.isEmpty()) args.takeFirst();
57     if (args.count() >= 4) {
58         bool erase = false;
59         if (args.at(0) == "-erase") {
60             erase = true;
61             args.takeFirst();
62         }
63         if (args.at(0).startsWith("in=")) {
64             in = args.at(0).section('=', -1).toInt();
65             args.takeFirst();
66         }
67         if (args.at(0).startsWith("out=")) {
68             out = args.at(0).section('=', -1).toInt();
69             args.takeFirst();
70         }
71         QString render = args.at(0);
72         args.takeFirst();
73         QString player = args.at(0);
74         args.takeFirst();
75         QString src = args.at(0);
76         args.takeFirst();
77         QString dest = args.at(0);
78         args.takeFirst();
79         RenderJob *job = new RenderJob(erase, render, player, src, dest, args, in, out);
80         job->start();
81         app.exec();
82     } else {
83         fprintf(stderr, "Kdenlive video renderer for MLT.\nUsage: "
84                 "kdenlive_render [-erase] [in=pos] [out=pos] [renderer] [player] [src] [dest] [[arg1] [arg2] ...]\n"
85                 "  -erase: if that parameter is present, src file will be erased at the end\n"
86                 "  in=pos: start rendering at frame pos\n"
87                 "  out=pos: end rendering at frame pos\n"
88                 "  render: path to inigo rendrer\n"
89                 "  player: path to video player to play when rendering is over, use '-' to disable playing\n"
90                 "  src: source file (usually westley playlist)\n"
91                 "  dest: destination file\n"
92                 "  args: space separated libavformat arguments\n");
93     }
94 }
95