@@ -95,12 +95,22 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
95
95
96
96
int main ( int argc, char ** argv )
97
97
{
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 += " \t avprocessor CONFIG.TXT OUTPUT_FILE_NAME [--generate-black] [--generate-silence] [--help]\n " ;
101
+ help += " CONFIG.TXT\n " ;
102
+ help += " \t Each line will be one stream in the output.\n " ;
103
+ help += " \t Pattern of each line is:\n " ;
104
+ help += " \t [inputFile]=STREAM_ID.[subStreamId]:[profileName]\n " ;
105
+ help += " \t No inputFile: will generate black image / audio silence (audio by default)\n " ;
106
+ help += " \t No subStreamId: will process of channels of the stream\n " ;
107
+ help += " \t No 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
104
114
std::vector< std::string > arguments;
105
115
for ( int argument = 1 ; argument < argc; ++argument )
106
116
{
@@ -116,6 +126,19 @@ int main( int argc, char** argv )
116
126
{
117
127
useAudioGenerator = true ;
118
128
}
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 );
119
142
}
120
143
121
144
av_log_set_level ( AV_LOG_FATAL );
0 commit comments