V2.0.2
1.修改老师和学生视频大小不一致,老师的视频小于320x240时,老师背景有花屏 2.修改老师和学生视频都为240x180视频时,视频宽度仍为240, 且有花屏 3.只有一路视频时,默认合成为上下布局
正在显示
3 个修改的文件
包含
21 行增加
和
5 行删除
| @@ -36,9 +36,11 @@ _studentFrame(NULL) | @@ -36,9 +36,11 @@ _studentFrame(NULL) | ||
| 36 | _scaled_height = _src_height * 10 / 32; | 36 | _scaled_height = _src_height * 10 / 32; |
| 37 | _one2one = bOne2One; | 37 | _one2one = bOne2One; |
| 38 | if (_one2one) { | 38 | if (_one2one) { |
| 39 | + _nOutputWidth = _src_width; | ||
| 39 | _nOutputHeight = _src_height * 2; | 40 | _nOutputHeight = _src_height * 2; |
| 40 | } | 41 | } |
| 41 | else { | 42 | else { |
| 43 | + _nOutputWidth = _src_width; | ||
| 42 | _nOutputHeight = _src_height; | 44 | _nOutputHeight = _src_height; |
| 43 | 45 | ||
| 44 | init_scale_context(&_sws_ctx_w_h, &_scaled_frame_w_h, _src_width, _src_height, _scaled_width, _scaled_height); | 46 | init_scale_context(&_sws_ctx_w_h, &_scaled_frame_w_h, _src_width, _src_height, _scaled_width, _scaled_height); |
| @@ -636,7 +638,12 @@ int CAVTranscoder::open_output_file(const char *filename) | @@ -636,7 +638,12 @@ int CAVTranscoder::open_output_file(const char *filename) | ||
| 636 | fillDestFrame(pDstFrame, _teacherFrame, (_src_width - _src_height) / 2, 0); | 638 | fillDestFrame(pDstFrame, _teacherFrame, (_src_width - _src_height) / 2, 0); |
| 637 | } | 639 | } |
| 638 | else { | 640 | else { |
| 639 | - printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height); | 641 | + //printf("\nresolution: %dx%d unexpected!", _teacherFrame->width, _teacherFrame->height); |
| 642 | + memset(pDstFrame->data[0], _blank_y, _nOutputWidth * _nOutputHeight / 2); | ||
| 643 | + memset(pDstFrame->data[1], _blank_u, _nOutputWidth * _nOutputHeight / 8); | ||
| 644 | + memset(pDstFrame->data[2], _blank_v, _nOutputWidth * _nOutputHeight / 8); | ||
| 645 | + | ||
| 646 | + fillDestFrame(pDstFrame, _teacherFrame, 0, 0); | ||
| 640 | } | 647 | } |
| 641 | if (_studentFrame) { | 648 | if (_studentFrame) { |
| 642 | if (_studentFrame->width == _src_width) { | 649 | if (_studentFrame->width == _src_width) { |
| @@ -682,7 +689,11 @@ int CAVTranscoder::open_output_file(const char *filename) | @@ -682,7 +689,11 @@ int CAVTranscoder::open_output_file(const char *filename) | ||
| 682 | fillDestFrame(pDstFrame, _studentFrame, (_src_width - _src_height) / 2, 0); | 689 | fillDestFrame(pDstFrame, _studentFrame, (_src_width - _src_height) / 2, 0); |
| 683 | } | 690 | } |
| 684 | else { | 691 | else { |
| 685 | - printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height); | 692 | + //printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height); |
| 693 | + memset(pDstFrame->data[0], _blank_y, _nOutputWidth * _nOutputHeight / 2); | ||
| 694 | + memset(pDstFrame->data[1], _blank_u, _nOutputWidth * _nOutputHeight / 8); | ||
| 695 | + memset(pDstFrame->data[2], _blank_v, _nOutputWidth * _nOutputHeight / 8); | ||
| 696 | + fillDestFrame(pDstFrame, _studentFrame, 0, 0); | ||
| 686 | } | 697 | } |
| 687 | } | 698 | } |
| 688 | 699 |
| @@ -38,4 +38,9 @@ m_1.mp4 859282931_20181112133025316.mp4 3397.150 | @@ -38,4 +38,9 @@ m_1.mp4 859282931_20181112133025316.mp4 3397.150 | ||
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | V2.0.1 | 40 | V2.0.1 |
| 41 | -1.修改bug: 复制缩小后的视频时,U、V分量x偏移不正确 | ||
| 41 | +1.修改bug: 复制缩小后的视频时,U、V分量x偏移不正确 | ||
| 42 | + | ||
| 43 | +V2.0.2 | ||
| 44 | +1.修改学生视频为320x240,老师的视频为240x180时,老师背景有花屏 | ||
| 45 | +2.修改老师和学生视频都为240x180视频时,视频宽度仍为240, 且有花屏 | ||
| 46 | +3.只有一路视频时,默认合成为上下布局 |
| @@ -1050,7 +1050,7 @@ int process_av_files(char * record_info, int piptype) | @@ -1050,7 +1050,7 @@ int process_av_files(char * record_info, int piptype) | ||
| 1050 | av_register_all(); | 1050 | av_register_all(); |
| 1051 | avfilter_register_all(); | 1051 | avfilter_register_all(); |
| 1052 | 1052 | ||
| 1053 | - bool one2one = max_audio == 2; | 1053 | + bool one2one = max_audio <= 2; |
| 1054 | if (1 == piptype) { | 1054 | if (1 == piptype) { |
| 1055 | one2one = true; | 1055 | one2one = true; |
| 1056 | printf("using one2one layout\n"); | 1056 | printf("using one2one layout\n"); |
| @@ -1143,7 +1143,7 @@ int process_av_files(char * record_info, int piptype) | @@ -1143,7 +1143,7 @@ int process_av_files(char * record_info, int piptype) | ||
| 1143 | int main(int argc, char * argv[]) | 1143 | int main(int argc, char * argv[]) |
| 1144 | { | 1144 | { |
| 1145 | if (argc < 2) { | 1145 | if (argc < 2) { |
| 1146 | - printf(" merge_pip 2.0.1\n"); | 1146 | + printf(" merge_pip 2.0.2\n"); |
| 1147 | printf(" merge video files to one pip video according to record info file,\nusage:"); | 1147 | printf(" merge video files to one pip video according to record info file,\nusage:"); |
| 1148 | printf("\n %s record_info_filename [-t {0,1,2}]", argv[0]); | 1148 | printf("\n %s record_info_filename [-t {0,1,2}]", argv[0]); |
| 1149 | printf("\n\n"); | 1149 | printf("\n\n"); |
-
请 注册 或 登录 后发表评论