Skip to content

Commit d369434

Browse files
author
Clement Champetier
committed
avprocessor: add help in command line
1 parent febe4fb commit d369434

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

app/avProcessor/avProcessor.cpp

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,22 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
9595

9696
int main( int argc, char** argv )
9797
{
98-
if( argc < 3 )
99-
{
100-
std::cout << "avprocessor require an input config file and an output media filename" << std::endl;
101-
return( -1 );
102-
}
103-
98+
std::string help;
99+
help += "Usage\n";
100+
help += "\tavprocessor CONFIG.TXT OUTPUT_FILE_NAME [--generate-black] [--generate-silence] [--help]\n";
101+
help += "CONFIG.TXT\n";
102+
help += "\tEach line will be one stream in the output.\n";
103+
help += "\tPattern of each line is:\n";
104+
help += "\t[inputFile]=STREAM_ID.[subStreamId]:[profileName]\n";
105+
help += "\tNo inputFile: will generate black image / audio silence (audio by default)\n";
106+
help += "\tNo subStreamId: will process of channels of the stream\n";
107+
help += "\tNo profileName: will rewrap the stream\n";
108+
help += "Command line options\n";
109+
help += "\t--generate-black: stream which not referred to an input, will generate an output video stream with black images\n";
110+
help += "\t--generate-silent: stream which not referred to an input, will generate an output audio stream with silence\n";
111+
help += "\t--help: display this help\n";
112+
113+
// List command line arguments
104114
std::vector< std::string > arguments;
105115
for( int argument = 1; argument < argc; ++argument )
106116
{
@@ -116,6 +126,19 @@ int main( int argc, char** argv )
116126
{
117127
useAudioGenerator = true;
118128
}
129+
else if( arguments.at( argument ) == "--help" )
130+
{
131+
std::cout << help << std::endl;
132+
return 0;
133+
}
134+
}
135+
136+
// Check required arguments
137+
if( argc < 3 )
138+
{
139+
std::cout << "avprocessor can rewrap or transcode inputs to create an output media file." << std::endl;
140+
std::cout << "Use option --help to display help" << std::endl;
141+
return( -1 );
119142
}
120143

121144
av_log_set_level( AV_LOG_FATAL );

0 commit comments

Comments
 (0)