V2.0.12
1.在一对一时,强制老师和学生的视频大小一致,且宽高比均为4:3,当不为4:3时,保持视频原始宽高比,水平或垂直居中
正在显示
4 个修改的文件
包含
13 行增加
和
5 行删除
| @@ -34,7 +34,7 @@ int g_fps; | @@ -34,7 +34,7 @@ int g_fps; | ||
| 34 | 34 | ||
| 35 | #define ensure_no_zero(x, v) if(!x) x = v | 35 | #define ensure_no_zero(x, v) if(!x) x = v |
| 36 | 36 | ||
| 37 | -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) : | 37 | +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,int keep_4_3) : |
| 38 | _start_time(INT64_MAX), | 38 | _start_time(INT64_MAX), |
| 39 | _all_processed(true), | 39 | _all_processed(true), |
| 40 | _nOutputWidth(320), | 40 | _nOutputWidth(320), |
| @@ -90,7 +90,12 @@ _one2one_same_size(one2one_same_size) | @@ -90,7 +90,12 @@ _one2one_same_size(one2one_same_size) | ||
| 90 | 90 | ||
| 91 | double max_ratio = max(wh_ratio_teacher, wh_ratio_student); | 91 | double max_ratio = max(wh_ratio_teacher, wh_ratio_student); |
| 92 | _teacher_width = _student_width = max_width; | 92 | _teacher_width = _student_width = max_width; |
| 93 | - _teacher_height = _student_height = (int)(max_width / max_ratio + 0.5); | 93 | + if (keep_4_3){ |
| 94 | + _teacher_height = _student_height = _teacher_width * 3 / 4; | ||
| 95 | + } | ||
| 96 | + else{ | ||
| 97 | + _teacher_height = _student_height = (int)(max_width / max_ratio + 0.5); | ||
| 98 | + } | ||
| 94 | } | 99 | } |
| 95 | 100 | ||
| 96 | _nOutputHeight = _teacher_height + _student_height; | 101 | _nOutputHeight = _teacher_height + _student_height; |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | class CAVTranscoder | 5 | class CAVTranscoder |
| 6 | { | 6 | { |
| 7 | public: | 7 | public: |
| 8 | - 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); | 8 | + 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, int keep_4_3= true); |
| 9 | virtual ~CAVTranscoder(); | 9 | virtual ~CAVTranscoder(); |
| 10 | 10 | ||
| 11 | int add(media_info & info); | 11 | int add(media_info & info); |
| @@ -98,4 +98,7 @@ V2.0.10 | @@ -98,4 +98,7 @@ V2.0.10 | ||
| 98 | 2.一对多布局时,支持对不同分辨率的老师视频进行缩放,统一到相同分辨率 | 98 | 2.一对多布局时,支持对不同分辨率的老师视频进行缩放,统一到相同分辨率 |
| 99 | 99 | ||
| 100 | V2.0.11 | 100 | V2.0.11 |
| 101 | -1.修改1对多布局时,缺省不扩大合成视频大小,-t 3参数时才根据学生数量扩大合成视频大小 | ||
| 101 | +1.修改1对多布局时,缺省不扩大合成视频大小,-t 3参数时才根据学生数量扩大合成视频大小 | ||
| 102 | + | ||
| 103 | +V2.0.12 | ||
| 104 | +1.在一对一时,强制老师和学生的视频大小一致,且宽高比均为4:3,当不为4:3时,保持视频原始宽高比,水平或垂直居中 |
| @@ -1223,7 +1223,7 @@ int process_av_files(char * record_info, int piptype, bool one2one_same_size, in | @@ -1223,7 +1223,7 @@ int process_av_files(char * record_info, int piptype, bool one2one_same_size, in | ||
| 1223 | int main(int argc, char * argv[]) | 1223 | int main(int argc, char * argv[]) |
| 1224 | { | 1224 | { |
| 1225 | if (argc < 2) { | 1225 | if (argc < 2) { |
| 1226 | - printf(" merge_pip 2.0.11\n"); | 1226 | + printf(" merge_pip 2.0.12\n"); |
| 1227 | printf(" merge video files to one pip video according to record info file,\nusage:"); | 1227 | printf(" merge video files to one pip video according to record info file,\nusage:"); |
| 1228 | printf("\n %s record_info_filename [-t {0,1,2,3}] [-c codec.cfg] [-s {1,0}]", argv[0]); | 1228 | printf("\n %s record_info_filename [-t {0,1,2,3}] [-c codec.cfg] [-s {1,0}]", argv[0]); |
| 1229 | printf("\n\n"); | 1229 | printf("\n\n"); |
-
请 注册 或 登录 后发表评论