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
胡斌
2017-12-01 07:23:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
db0155f1add65889e14017824e6360d562ec8360
db0155f1
1 parent
8c30879c
fix compile error in linux
显示空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
13 行增加
和
5 行删除
merge_av/merge_av.cpp
merge_av/merge_av.cpp
查看文件 @
db0155f
...
...
@@ -102,21 +102,21 @@ void get_video_first_frame_jpeg(fileinfo video, char * destfile)
run_shell_cmd
(
buf
);
}
void
merge_audio_pic
(
fileinfo
audio
,
int
nf
,
fileinfo
video
,
char
*
destfile
)
void
merge_audio_pic
(
fileinfo
audio
,
int
nf
,
fileinfo
video
,
c
onst
c
har
*
destfile
)
{
char
buf
[
2048
];
sprintf
(
buf
,
"ffmpeg -y -loop 1 -i %s.jpg -i %d_%s -loop 0 -shortest %s %s %s"
,
video
.
name
.
c_str
(),
nf
,
audio
.
name
.
c_str
(),
acodec_param
,
vcodec_param
,
destfile
);
run_shell_cmd
(
buf
);
}
void
megre_audio_video
(
fileinfo
audio
,
int
nf
,
fileinfo
video
,
char
*
destfile
)
void
megre_audio_video
(
fileinfo
audio
,
int
nf
,
fileinfo
video
,
c
onst
c
har
*
destfile
)
{
char
buf
[
2048
];
sprintf
(
buf
,
"ffmpeg -y -i %d_%s -i %s %s %s %s"
,
nf
,
audio
.
name
.
c_str
(),
video
.
name
.
c_str
(),
acodec_param
,
vcodec_param
,
destfile
);
run_shell_cmd
(
buf
);
}
void
concate_files
(
vector
<
string
>
merged_files
,
char
*
destfile
)
void
concate_files
(
vector
<
string
>
merged_files
,
c
onst
c
har
*
destfile
)
{
char
buf
[
2048
];
#ifdef WIN32
...
...
@@ -140,21 +140,29 @@ void concate_files(vector<string > merged_files, char * destfile)
run_shell_cmd
(
buf
);
}
void
adjust_dest_timecode
(
c
har
*
src
,
char
*
dest
)
void
adjust_dest_timecode
(
c
onst
char
*
src
,
const
char
*
dest
)
{
char
buf
[
2048
];
sprintf
(
buf
,
"ffmpeg -y -i %s -acodec copy -vcodec copy %s"
,
src
,
dest
);
run_shell_cmd
(
buf
);
}
#ifndef WIN32
#include <unistd.h>
#endif
void
removefiles
(
vector
<
string
>
files
)
{
for
(
int
i
=
0
;
i
<
files
.
size
();
i
++
)
{
#ifdef WIN32
_unlink
(
files
[
i
].
c_str
());
#else
unlink
(
files
[
i
].
c_str
());
#endif
}
}
int
process_files
(
char
*
output_dest_file
)
int
process_files
(
c
onst
c
har
*
output_dest_file
)
{
vector
<
fileinfo
>
&
filesaudio
=
media_files
[
type_audio
];
vector
<
fileinfo
>
&
filesvideo
=
media_files
[
type_video
];
...
...
请
注册
或
登录
后发表评论