MythTV  master
mythtranscode/commandlineparser.cpp
Go to the documentation of this file.
1 #include <QString>
2 
3 #include "mythcorecontext.h"
4 #include "commandlineparser.h"
5 
9 
11 {
12  addHelp();
13  addVersion();
14  addJob();
15  addRecording();
17  addLogging();
18 
19  add(QStringList{"-p", "--profile"}, "profile", "",
20  "Transcoding profile.", "")
21  ->SetGroup("Encoding");
22  add(QStringList{"--allkeys", "-k"}, "allkeys", false,
23  "Specifies the outputfile should be entirely keyframes.", "")
24  ->SetGroup("Encoding");
25  add("--passthrough", "passthru", false,
26  "Pass through raw, unprocessed audio.", "")
27  ->SetGroup("Encoding");
28  add(QStringList{"-ro", "--recorderOptions"}, "recopt",
29  "", "Comma separated list of recordingprofile overrides.", "")
30  ->SetGroup("Encoding");
31  add("--audiotrack", "audiotrack", 0, "Select specific audio track.", "")
32  ->SetGroup("Encoding");
33  add("--allaudiotracks", "allaudio", 0,
34  "Keep all audio tracks including those marked with 0 channels.", "")
35  ->SetGroup("Encoding");
36  add(QStringList{"-m", "--mpeg2"}, "mpeg2", false,
37  "Specifies that a lossless transcode should be used.", "")
38  ->SetGroup("Encoding");
39  add(QStringList{"-e", "--ostream"}, "ostream", "",
40  "Output stream type: ps, dvd, ts (Default: ps)", "")
41  ->SetGroup("Encoding");
42  add("--avf", "avf", false, "Generate libavformat output file.", "")
43  ->SetGroup("Encoding");
44  add("--hls", "hls", false, "Generate HTTP Live Stream output.", "")
45  ->SetGroup("Encoding");
46 
47  add(QStringList{"-f", "--fifodir"}, "fifodir", "",
48  "Directory in which to write fifos to.", "")
49  ->SetGroup("Frame Server");
50  add("--fifoinfo", "fifoinfo", false,
51  "Run in fifodir mode, but stop after displaying the "
52  "fifo data format.", "")
53  ->SetGroup("Frame Server");
54  add("--fifosync", "fifosync", false, "Enforce fifo sync.", "")
55  ->SetGroup("Frame Server");
56  add("--cleancut", "cleancut", false,
57  "Improve quality of cutting by performing it partially by dropping data. "
58  "Works only in fifodir mode.", "")
59  ->SetGroup("Frame Server")
60  ->SetRequires("fifodir");
61 
62  add(QStringList{"-l", "--honorcutlist"}, "usecutlist",
63  "", "Specifies whether to use the cutlist. "
64  "(Takes an optional cutlist as argument when used with -i)",
65  "Specifies whether transcode should honor the cutlist and "
66  "remove the marked off commercials. Optionally takes a "
67  "a cutlist as an argument when used with --infile.")
68  ->SetGroup("Cutlist");
69  add("--inversecut", "inversecut", false,
70  "Inverses the cutlist, leaving only the marked off sections.", "")
71  ->SetGroup("Cutlist")
72  ->SetRequires("usecutlist");
73 
74  add("--showprogress", "showprogress", false,
75  "Display status info in stdout", "")
76  ->SetGroup("Logging");
77 
78  add(QStringList{"-i", "--infile"}, "inputfile", "",
79  "Input video for transcoding.", "");
80  add(QStringList{"-o", "--outfile"}, "outputfile", "",
81  "Optional output file for transcoding.", "");
82  add(QStringList{"-b", "--buildindex"}, "reindex", false,
83  "Build new keyframe index.", "");
84  add("--video", "video", false,
85  "Specifies video is not a recording.", "")
86  ->SetRequires("inputfile");
87  add("--queue", "queue", "",
88  "Add a new transcoding job of the specified recording and "
89  "profile to the jobqueue. Accepts an optional string to define "
90  "the hostname.", "");
91 
92 // add("--container", "container", "", "Output file container format", "")
93 // ->SetChildOf("avf");
94 // add("--acodec", "acodec", "", "Output file audio codec", "")
95 // ->SetChildOf("avf");
96 // add("--vcodec", "vcodec", "", "Output file video codec", "")
97 // ->SetChildOf("avf");
98  add("--width", "width", 0, "Output Video Width", "")
99  ->SetChildOf("avf")
100  ->SetChildOf("hls");
101  add("--height", "height", 0, "Output Video Height", "")
102  ->SetChildOf("avf")
103  ->SetChildOf("hls");
104  add("--bitrate", "bitrate", 800, "Output Video Bitrate (Kbits)", "")
105  ->SetChildOf("avf")
106  ->SetChildOf("hls");
107  add("--audiobitrate", "audiobitrate", 64, "Output Audio Bitrate (Kbits)", "")
108  ->SetChildOf("avf")
109  ->SetChildOf("hls");
110  add("--maxsegments", "maxsegments", 0, "Max HTTP Live Stream segments", "")
111  ->SetChildOf("hls");
112  add("--noaudioonly", "noaudioonly", 0, "Disable Audio-Only HLS Stream", "")
113  ->SetChildOf("hls");
114  add("--hlsstreamid", "hlsstreamid", -1, "Stream ID to process", "")
115  ->SetChildOf("hls");
116  add(QStringList{"-d", "--delete"}, "delete", false,
117  "Delete original after successful transcoding", "")
118  ->SetGroup("Encoding");
119 }
CommandLineArg * add(QString arg, QString name, bool def, QString help, QString longhelp)
Parent class for defining application command line parsers.
void addVersion(void)
Canned argument definition for –version.
void addLogging(const QString &defaultVerbosity="general", LogLevel_t defaultLogLevel=LOG_INFO)
Canned argument definition for all logging options, including –verbose, –logpath, –quiet,...
void addHelp(void)
Canned argument definition for –help.
CommandLineArg * SetChildOf(const QString &opt)
Set argument as child of given parent.
void addJob(void)
Canned argument definition for –jobid.
#define MYTH_APPNAME_MYTHTRANSCODE
CommandLineArg * SetGroup(const QString &group)
void addSettingsOverride(void)
Canned argument definition for –override-setting and –override-settings-file.
CommandLineArg * SetRequires(const QString &opt)
Set argument as requiring given option.
void addRecording(void)
Canned argument definition for –chanid and –starttime.