|
|
|
@ -76,17 +76,25 @@ int main(int argc, char** argv)
|
|
|
|
|
exit(-1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// parse options in FFMPEG format.
|
|
|
|
|
while ((opt = getopt(argc, argv, "i:y:")) != -1) {
|
|
|
|
|
switch (opt) {
|
|
|
|
|
case 'i':
|
|
|
|
|
in_flv_file = optarg;
|
|
|
|
|
break;
|
|
|
|
|
case 'y':
|
|
|
|
|
out_rtmp_url = optarg;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
for (opt = 0; opt < argc; opt++) {
|
|
|
|
|
srs_human_trace("argv[%d]=%s", opt, argv[opt]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// fill the options for mac
|
|
|
|
|
for (opt = 0; opt < argc - 1; opt++) {
|
|
|
|
|
// ignore all options except -i and -y.
|
|
|
|
|
char* p = argv[opt];
|
|
|
|
|
|
|
|
|
|
// only accept -x
|
|
|
|
|
if (p[0] != '-' || p[1] == 0 || p[2] != 0) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// parse according the option name.
|
|
|
|
|
switch (p[1]) {
|
|
|
|
|
case 'i': in_flv_file = argv[opt + 1]; break;
|
|
|
|
|
case 'y': out_rtmp_url = argv[opt + 1]; break;
|
|
|
|
|
default: break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|