Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
merge_av
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
胡斌
2019-06-06 22:07:49 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dcdb2ca97649b27e788e010d1b33223c38ca1917
dcdb2ca9
1 parent
61edffa6
V2.0.8
1.修改在一对一布局下,有学生或老师视频需要缩放时,如果学生或老师有多个段,会出现程序异常 2.修改在一对一布局下,不需要缩放时,学生视频如果宽度小于输出视频宽度,输出视频有部分背景花屏
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
26 行增加
和
8 行删除
pip/AVTranscoder.cpp
pip/ReadMe.txt
pip/merge_pip.cpp
pip/AVTranscoder.cpp
查看文件 @
dcdb2ca
...
...
@@ -722,10 +722,9 @@ int CAVTranscoder::open_output_file(const char *filename)
}
int
CAVTranscoder
::
scale_fill_one2one_teacherframe
(
AVFrame
*
pDstFrame
)
{
if
(
_scaled_frame_teacher
!=
_teacherFrame
)
{
if
(
_src_width_teacher
!=
_teacherFrame
->
width
||
_src_height_teacher
!=
_teacherFrame
->
height
)
{
//init scale context
free_scale_context
(
&
_sws_ctx_teacher
,
&
_scaled_frame_teacher
);
...
...
@@ -745,6 +744,7 @@ int CAVTranscoder::open_output_file(const char *filename)
av_frame_free
(
&
_teacherFrame
);
_teacherFrame
=
_scaled_frame_teacher
;
}
if
(
_teacherFrame
->
pkt_dts
==
0
||
_teacherFrame
->
pkt_dts
==
180
)
{
if
(
_teacher_width
!=
_teacherFrame
->
width
||
_teacher_height
!=
_teacherFrame
->
height
){
...
...
@@ -774,6 +774,7 @@ int CAVTranscoder::open_output_file(const char *filename)
int
CAVTranscoder
::
scale_fill_one2one_studentframe
(
AVFrame
*
pDstFrame
,
int
y
)
{
if
(
_scaled_frame_student
!=
_studentFrame
)
{
if
(
_src_width_student
!=
_studentFrame
->
width
||
_src_height_student
!=
_studentFrame
->
height
)
{
//init scale context
free_scale_context
(
&
_sws_ctx_student
,
&
_scaled_frame_student
);
...
...
@@ -793,6 +794,7 @@ int CAVTranscoder::open_output_file(const char *filename)
av_frame_free
(
&
_studentFrame
);
_studentFrame
=
_scaled_frame_student
;
}
if
(
_studentFrame
->
pkt_dts
==
0
||
_studentFrame
->
pkt_dts
==
180
)
{
if
(
_teacher_width
!=
_studentFrame
->
width
||
_teacher_height
!=
_studentFrame
->
height
){
...
...
@@ -823,6 +825,7 @@ int CAVTranscoder::open_output_file(const char *filename)
int
CAVTranscoder
::
fill_one2one_student_frame
(
AVFrame
*
pDstFrame
,
int
y
)
{
/*
if (_studentFrame->width == _student_width && _studentFrame->height == _student_height) {
if (_studentFrame->pkt_dts != 90){
fillDestFrame(pDstFrame, _studentFrame, 0, y);
...
...
@@ -842,18 +845,29 @@ int CAVTranscoder::open_output_file(const char *filename)
else if (_studentFrame->width == _student_height && _studentFrame->height == _student_height) {
fillDestFrame(pDstFrame, _studentFrame, (_nOutputWidth - _student_height) / 2, y);
}
else
{
else {
*/
if
(
_one2one_same_size
){
scale_fill_one2one_studentframe
(
pDstFrame
,
y
);
}
else
{
//printf("\nresolution: %dx%d unexpected!", _studentFrame->width, _studentFrame->height);
memset
(
pDstFrame
->
data
[
0
]
+
y
*
pDstFrame
->
linesize
[
0
],
_blank_y
,
pDstFrame
->
linesize
[
0
]
*
_teacher_height
);
memset
(
pDstFrame
->
data
[
1
]
+
y
*
pDstFrame
->
linesize
[
1
]
/
2
,
_blank_u
,
pDstFrame
->
linesize
[
1
]
*
_teacher_height
/
2
);
memset
(
pDstFrame
->
data
[
2
]
+
y
*
pDstFrame
->
linesize
[
2
]
/
2
,
_blank_v
,
pDstFrame
->
linesize
[
2
]
*
_teacher_height
/
2
);
if
(
_studentFrame
->
pkt_dts
==
0
||
_studentFrame
->
pkt_dts
==
180
)
{
if
(
_studentFrame
->
width
<
_nOutputWidth
||
_studentFrame
->
height
<
_nOutputHeight
-
y
)
{
memset
(
pDstFrame
->
data
[
0
]
+
y
*
pDstFrame
->
linesize
[
0
],
_blank_y
,
pDstFrame
->
linesize
[
0
]
*
_student_height
);
memset
(
pDstFrame
->
data
[
1
]
+
y
*
pDstFrame
->
linesize
[
1
]
/
2
,
_blank_u
,
pDstFrame
->
linesize
[
1
]
*
_student_height
/
2
);
memset
(
pDstFrame
->
data
[
2
]
+
y
*
pDstFrame
->
linesize
[
2
]
/
2
,
_blank_v
,
pDstFrame
->
linesize
[
2
]
*
_student_height
/
2
);
}
fillDestFrame
(
pDstFrame
,
_studentFrame
,
0
,
y
);
}
else
{
if
(
_studentFrame
->
height
<
_nOutputWidth
||
_studentFrame
->
width
<
_nOutputHeight
-
y
)
{
memset
(
pDstFrame
->
data
[
0
]
+
y
*
pDstFrame
->
linesize
[
0
],
_blank_y
,
pDstFrame
->
linesize
[
0
]
*
_student_height
);
memset
(
pDstFrame
->
data
[
1
]
+
y
*
pDstFrame
->
linesize
[
1
]
/
2
,
_blank_u
,
pDstFrame
->
linesize
[
1
]
*
_student_height
/
2
);
memset
(
pDstFrame
->
data
[
2
]
+
y
*
pDstFrame
->
linesize
[
2
]
/
2
,
_blank_v
,
pDstFrame
->
linesize
[
2
]
*
_student_height
/
2
);
}
fillDestFrame
(
pDstFrame
,
_studentFrame
,
0
,
y
);
}
}
//}
return
0
;
}
...
...
pip/ReadMe.txt
查看文件 @
dcdb2ca
...
...
@@ -84,3 +84,7 @@ V2.0.6
V2.0.7
1.修改bug: 在V2.0.4开放了设置视频编码参数,由于修改不完整,其中fps设置如果不是默认的参数20,会导致音视频不同步。
2.修改在一对一布局下,有一个视频是竖屏时,对竖屏的缩放处理不正常
V2.0.8
1.修改在一对一布局下,有学生或老师视频需要缩放时,如果学生或老师有多个段,会出现程序异常
2.修改在一对一布局下,不需要缩放时,学生视频如果宽度小于输出视频宽度,输出视频有部分背景花屏
\ No newline at end of file
...
...
pip/merge_pip.cpp
查看文件 @
dcdb2ca
...
...
@@ -1211,7 +1211,7 @@ 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.
7
\n
"
);
printf
(
" merge_pip 2.0.
8
\n
"
);
printf
(
" merge video files to one pip video according to record info file,
\n
usage:"
);
printf
(
"
\n
%s record_info_filename [-t {0,1,2}] [-c codec.cfg] [-s {1,0}]"
,
argv
[
0
]);
printf
(
"
\n\n
"
);
...
...
请
注册
或
登录
后发表评论