diff --git a/trunk/research/librtmp/srs_ingest_flv.c b/trunk/research/librtmp/srs_ingest_flv.c
index ef3a01950..88a8b981b 100644
--- a/trunk/research/librtmp/srs_ingest_flv.c
+++ b/trunk/research/librtmp/srs_ingest_flv.c
@@ -105,7 +105,7 @@ int main(int argc, char** argv)
return -1;
}
- srs_human_trace("input: %s", in_flv_file);
+ srs_human_trace("input: %s", in_flv_file);
srs_human_trace("output: %s", out_rtmp_url);
if ((flv = srs_flv_open_read(in_flv_file)) == NULL) {
diff --git a/trunk/research/librtmp/srs_ingest_mp4.c b/trunk/research/librtmp/srs_ingest_mp4.c
index d75a9b755..06532d054 100644
--- a/trunk/research/librtmp/srs_ingest_mp4.c
+++ b/trunk/research/librtmp/srs_ingest_mp4.c
@@ -26,10 +26,9 @@
#include "../../objs/include/srs_librtmp.h"
+int proxy(srs_mp4_t mp4, srs_rtmp_t ortmp);
int main(int argc, char** argv)
{
- int ret, opt;
-
printf("Ingest mp4 file and publish to RTMP server like FFMPEG.\n");
printf("SRS(OSSRS) client librtmp library.\n");
printf("Version: %d.%d.%d\n", srs_version_major(), srs_version_minor(), srs_version_revision());
@@ -46,10 +45,211 @@ int main(int argc, char** argv)
exit(-1);
}
- for (opt = 0; opt < argc; opt++) {
- srs_human_trace("argv[%d]=%s", opt, argv[opt]);
+ for (int opt = 0; opt < argc; opt++) {
+ srs_human_trace("The argv[%d]=%s", opt, argv[opt]);
+ }
+
+ // fill the options for mac
+ char* in_file = NULL;
+ char* out_rtmp_url = NULL;
+ for (int 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_file = argv[opt + 1]; break;
+ case 'y': out_rtmp_url = argv[opt + 1]; break;
+ default: break;
+ }
+ }
+
+ if (!in_file) {
+ srs_human_trace("Invalid input file, use -i ");
+ return -1;
+ }
+ if (!out_rtmp_url) {
+ srs_human_trace("Invalid output url, use -y