]> git.sesse.net Git - kdenlive/blob - renderer/kdenlive_render.cpp
Trivially updated usage message to reflect the profile and rendermodule mandatory...
[kdenlive] / renderer / kdenlive_render.cpp
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include <stdio.h>
21 #include <QCoreApplication>
22 #include <QStringList>
23 #include <QString>
24 #include <QtDebug>
25
26 #include "renderjob.h"
27
28 int main(int argc, char **argv) {
29     QCoreApplication app(argc, argv);
30     QStringList args = app.arguments();
31     QStringList preargs;
32     int in = -1;
33     int out = -1;
34     if (!args.isEmpty()) args.takeFirst();
35     if (args.count() >= 4) {
36         bool erase = false;
37         if (args.at(0) == "-erase") {
38             erase = true;
39             args.takeFirst();
40         }
41         if (args.at(0).startsWith("in=")) {
42             in = args.at(0).section('=', -1).toInt();
43             args.takeFirst();
44         }
45         if (args.at(0).startsWith("out=")) {
46             out = args.at(0).section('=', -1).toInt();
47             args.takeFirst();
48         }
49         if (args.at(0).startsWith("preargs=")) {
50             QString a = args.at(0).section('=', 1);
51             preargs = a.split(" ", QString::SkipEmptyParts);
52             args.takeFirst();
53         }
54         QString render = args.at(0);
55         args.takeFirst();
56         QString profile = args.at(0);
57         args.takeFirst();
58         QString rendermodule = args.at(0);
59         args.takeFirst();
60         QString player = args.at(0);
61         args.takeFirst();
62         QString src = args.at(0);
63         args.takeFirst();
64         QString dest = args.at(0);
65         args.takeFirst();
66         RenderJob *job = new RenderJob(erase, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
67         job->start();
68         qDebug()<<"//STARTING RENDERING: "<<erase<<","<<render<<","<<profile<<","<<rendermodule<<","<<player<<","<<src<<","<<dest<<","<<preargs<<","<<args<<","<<in<<","<<out;
69         app.exec();
70     } else {
71         fprintf(stderr, "Kdenlive video renderer for MLT.\nUsage: "
72                 "kdenlive_render [-erase] [in=pos] [out=pos] [render] [profile] [rendermodule] [player] [src] [dest] [[arg1] [arg2] ...]\n"
73                 "  -erase: if that parameter is present, src file will be erased at the end\n"
74                 "  in=pos: start rendering at frame pos\n"
75                 "  out=pos: end rendering at frame pos\n"
76                 "  render: path to inigo render\n"
77                 "  profile: the MLT video profile\n"
78                 "  rendermodule: the MLT consumer used for rendering, usually it is avformat\n"
79                 "  player: path to video player to play when rendering is over, use '-' to disable playing\n"
80                 "  src: source file (usually westley playlist)\n"
81                 "  dest: destination file\n"
82                 "  args: space separated libavformat arguments\n");
83     }
84 }
85