胡斌

V2.0.11

1.修改1对多布局时,缺省不扩大合成视频大小,-t 3参数时才根据学生数量扩大合成视频大小
... ... @@ -34,7 +34,7 @@ int g_fps;
#define ensure_no_zero(x, v) if(!x) x = v
CAVTranscoder::CAVTranscoder(bool bOne2One, bool one2one_same_size, int width_teacher, int height_teacher, int width_student, int height_student, bool has_teacher, int max_audio) :
CAVTranscoder::CAVTranscoder(bool bOne2One, bool one2one_same_size, bool one2many_inflat, int width_teacher, int height_teacher, int width_student, int height_student, bool has_teacher, int max_audio) :
_start_time(INT64_MAX),
_all_processed(true),
_nOutputWidth(320),
... ... @@ -101,6 +101,11 @@ _one2one_same_size(one2one_same_size)
int extent_student_lines = n_students / 4;
int part_student = n_students % 4;
if (one2many_inflat == false) {
extent_student_lines = 0;
part_student = 0;
}
_pip_width = _scaled_height - pip_x_reduce; //use the scaled height,not the scaled width as pip_width
_pip_height = _scaled_height - pip_y_reduce;
... ...
... ... @@ -5,7 +5,7 @@
class CAVTranscoder
{
public:
CAVTranscoder(bool bOne2One, bool one2one_same_size, int width_teacher, int height_teacher, int student_width,int student_height, bool has_teacher, int max_audio);
CAVTranscoder(bool bOne2One, bool one2one_same_size, bool one2many_inflat, int width_teacher, int height_teacher, int student_width,int student_height, bool has_teacher, int max_audio);
virtual ~CAVTranscoder();
int add(media_info & info);
... ...
... ... @@ -28,7 +28,8 @@ student:下面是学生的录像信息文件,一个文件名一行
-t 为可选参数,后面必须跟0,1,或2。
0 为由程序自动选择合屏布局(目前根据录像信息文件里音频的起止时间,确定最多同时出现的人员数量,如果为2,则选用1对1布局).
1 为使用一对一布局
2 为使用一对多布局
2 为使用一对多布局,每排4个学生,由下向上排布
3 为使用一对多布局,最多只在老师视频下部排4个学生,多于4个学生的情况,扩大合成视频的高度,把学生视频排列在老师视频下方,保证老师视频部分最多只有一排学生视频,避免老师视频被过度遮挡
如果不加-t,则为程序自动选择合屏布局
-c 为可选参数,后面为编码配置文件名。缺省的编码配置文件名为merge_pip_codec.cfg。配置文件与merge_pip可执行文件在同一目录。
... ... @@ -94,4 +95,7 @@ V2.0.9
V2.0.10
1.修改一对多布局时,老师视频由多段不同分辨率视频组成时,会出现程序异常的问题
2.一对多布局时,支持对不同分辨率的老师视频进行缩放,统一到相同分辨率
\ No newline at end of file
2.一对多布局时,支持对不同分辨率的老师视频进行缩放,统一到相同分辨率
V2.0.11
1.修改1对多布局时,缺省不扩大合成视频大小,-t 3参数时才根据学生数量扩大合成视频大小
\ No newline at end of file
... ...
... ... @@ -1110,13 +1110,20 @@ int process_av_files(char * record_info, int piptype, bool one2one_same_size, in
one2one = false;
}
bool one_to_many_inflat = false;
if (1 == piptype) {
one2one = true;
printf("using one2one layout\n");
}
else if(2 == piptype){
one2one = false;
printf("using one2many layout\n");
printf("using one2many layout type 1\n");
}
else if (3 == piptype){
one2one = false;
one_to_many_inflat = true;
printf("using one2many layout type 2\n");
}
else {
if (one2one) {
... ... @@ -1132,7 +1139,7 @@ int process_av_files(char * record_info, int piptype, bool one2one_same_size, in
}
}
CAVTranscoder videoTranscoder(one2one, one2one_same_size, width_teacher, height_teacher, width_student, height_student, has_teacher, max_audio);
CAVTranscoder videoTranscoder(one2one, one2one_same_size, one_to_many_inflat, width_teacher, height_teacher, width_student, height_student, has_teacher, max_audio);
videoTranscoder.set_max_audio(max_audio);
int64_t cur_time = 0;
... ... @@ -1216,9 +1223,9 @@ int process_av_files(char * record_info, int piptype, bool one2one_same_size, in
int main(int argc, char * argv[])
{
if (argc < 2) {
printf(" merge_pip 2.0.10\n");
printf(" merge_pip 2.0.11\n");
printf(" merge video files to one pip video according to record info file,\nusage:");
printf("\n %s record_info_filename [-t {0,1,2}] [-c codec.cfg] [-s {1,0}]", argv[0]);
printf("\n %s record_info_filename [-t {0,1,2,3}] [-c codec.cfg] [-s {1,0}]", argv[0]);
printf("\n\n");
return -1;
}
... ... @@ -1230,7 +1237,7 @@ int main(int argc, char * argv[])
if (!strcmp(argv[i], "-t")){
i++;
if (i > argc) {
printf("error,should be 0, 1 or 2 after -t");
printf("error,should be 0, 1 ,2 or 3 after -t");
return -2;
}
piptype = atoi(argv[i]);
... ...