胡斌

V2.0.2

1.修改老师和学生视频大小不一致,老师的视频小于320x240时,老师背景有花屏
2.修改老师和学生视频都为240x180视频时,视频宽度仍为240, 且有花屏
3.只有一路视频时,默认合成为上下布局
... ... @@ -36,9 +36,11 @@ _studentFrame(NULL)
_scaled_height = _src_height * 10 / 32;
_one2one = bOne2One;
if (_one2one) {
_nOutputWidth = _src_width;
_nOutputHeight = _src_height * 2;
}
else {
_nOutputWidth = _src_width;
_nOutputHeight = _src_height;
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)
fillDestFrame(pDstFrame, _teacherFrame, (_src_width - _src_height) / 2, 0);
}
else {
printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height);
//printf("\nresolution: %dx%d unexpected!", _teacherFrame->width, _teacherFrame->height);
memset(pDstFrame->data[0], _blank_y, _nOutputWidth * _nOutputHeight / 2);
memset(pDstFrame->data[1], _blank_u, _nOutputWidth * _nOutputHeight / 8);
memset(pDstFrame->data[2], _blank_v, _nOutputWidth * _nOutputHeight / 8);
fillDestFrame(pDstFrame, _teacherFrame, 0, 0);
}
if (_studentFrame) {
if (_studentFrame->width == _src_width) {
... ... @@ -682,7 +689,11 @@ int CAVTranscoder::open_output_file(const char *filename)
fillDestFrame(pDstFrame, _studentFrame, (_src_width - _src_height) / 2, 0);
}
else {
printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height);
//printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height);
memset(pDstFrame->data[0], _blank_y, _nOutputWidth * _nOutputHeight / 2);
memset(pDstFrame->data[1], _blank_u, _nOutputWidth * _nOutputHeight / 8);
memset(pDstFrame->data[2], _blank_v, _nOutputWidth * _nOutputHeight / 8);
fillDestFrame(pDstFrame, _studentFrame, 0, 0);
}
}
... ...
... ... @@ -38,4 +38,9 @@ m_1.mp4 859282931_20181112133025316.mp4 3397.150
V2.0.1
1.修改bug: 复制缩小后的视频时,U、V分量x偏移不正确
\ No newline at end of file
1.修改bug: 复制缩小后的视频时,U、V分量x偏移不正确
V2.0.2
1.修改学生视频为320x240,老师的视频为240x180时,老师背景有花屏
2.修改老师和学生视频都为240x180视频时,视频宽度仍为240, 且有花屏
3.只有一路视频时,默认合成为上下布局
\ No newline at end of file
... ...
... ... @@ -1050,7 +1050,7 @@ int process_av_files(char * record_info, int piptype)
av_register_all();
avfilter_register_all();
bool one2one = max_audio == 2;
bool one2one = max_audio <= 2;
if (1 == piptype) {
one2one = true;
printf("using one2one layout\n");
... ... @@ -1143,7 +1143,7 @@ int process_av_files(char * record_info, int piptype)
int main(int argc, char * argv[])
{
if (argc < 2) {
printf(" merge_pip 2.0.1\n");
printf(" merge_pip 2.0.2\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}]", argv[0]);
printf("\n\n");
... ...