File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 2
2
#include < AvTranscoder/file/OutputFile.hpp>
3
3
4
4
static std::string outputFileName = " thumbnail.jpg" ;
5
+ static bool seekInFrame = false ;
5
6
6
7
int main ( int argc, char ** argv )
7
8
{
8
9
std::string help;
9
10
help += " Usage\n " ;
10
- help += " \t avthumbnail INPUT_FILE_NAME FRAME [OUTPUT_FILE_NAME] [--help]\n " ;
11
+ help += " \t avthumbnail INPUT_FILE_NAME TIME [OUTPUT_FILE_NAME] [--frame ] [--help]\n " ;
11
12
help += " Command line options\n " ;
12
13
help += " \t OUTPUT_FILE_NAME: name of the output file (thumbnail.jpg by default)\n " ;
14
+ help += " \t --frame: express TIME of where to seek in frame (in seconds by default)\n " ;
13
15
help += " \t --help: display this help\n " ;
14
16
15
17
// List command line arguments
@@ -25,6 +27,10 @@ int main( int argc, char** argv )
25
27
std::cout << help << std::endl;
26
28
return 0 ;
27
29
}
30
+ if ( arguments.at ( argument ) == " --frame" )
31
+ {
32
+ seekInFrame = true ;
33
+ }
28
34
}
29
35
if ( argc > 3 )
30
36
{
@@ -45,7 +51,10 @@ int main( int argc, char** argv )
45
51
// input file
46
52
std::string inputFileName ( argv[1 ] );
47
53
avtranscoder::InputFile intputFile ( inputFileName );
48
- intputFile.seekAtFrame ( atoi ( argv[2 ] ) );
54
+ if ( seekInFrame )
55
+ intputFile.seekAtFrame ( atoi ( argv[2 ] ) );
56
+ else
57
+ intputFile.seekAtTime ( atof ( argv[2 ] ) );
49
58
50
59
// output file
51
60
avtranscoder::ProfileLoader::Profile formatProfile;
You can’t perform that action at this time.
0 commit comments