胡斌

add command parameter [-t {0,1,2}] to sepcify video pip layout,

for 0,layout is decided by audio detect
for 1,using one2one layout
for 2,using one2many layout
... ... @@ -985,7 +985,7 @@ int load_record_info(char * record_info)
#define MIN_TIME_INTERVAL 25
int process_av_files(char * record_info)
int process_av_files(char * record_info, int piptype)
{
time_t start, end;
time(&start);
... ... @@ -996,7 +996,25 @@ int process_av_files(char * record_info)
av_register_all();
avfilter_register_all();
CAVTranscoder videoTranscoder(max_audio==2);
bool one2one = max_audio == 2;
if (1 == piptype) {
one2one = true;
printf("using one2one layout\n");
}
else if(2 == piptype){
one2one = false;
printf("using one2many layout\n");
}
else {
if (one2one) {
printf("using one2one layout,because detected max %d audio\n",max_audio);
}
else {
printf("using one2many layout,because detected max %d audio\n", max_audio);
}
}
CAVTranscoder videoTranscoder(one2one);
videoTranscoder.set_max_audio(max_audio);
int64_t cur_time = 0;
... ... @@ -1055,7 +1073,7 @@ int main(int argc, char * argv[])
if (argc < 2) {
printf(" merge_pip 2.0.0\n");
printf(" merge video files to one pip video according to record info file,\nusage:");
printf("\n %s record_info_filename", argv[0]);
printf("\n %s record_info_filename [-t {0,1,2}]", argv[0]);
printf("\n\n");
return -1;
}
... ... @@ -1064,11 +1082,16 @@ int main(int argc, char * argv[])
load_codec_param();
int piptype = 0;
for (int i = 2; i < argc; i++){
if (!strcmp(argv[i], "-d")){
out_one_video = false;
if (!strcmp(argv[i], "-t")){
i++;
if (i < argc) {
printf("error,should be 0,1 or 2 after -t");
}
piptype = atoi(argv[i]);
}
}
return process_av_files(argv[1]);
return process_av_files(argv[1], piptype);
}
... ...