Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FFmpeg-Examples
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
FFmpeg-Examples
Commits
44403df9
Commit
44403df9
authored
Mar 16, 2022
by
NzSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flush frames in encoders after all stream done.
parent
32cc2d6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
AudioTrackMerge.c
AudioTrackMerge.c
+17
-7
No files found.
AudioTrackMerge.c
View file @
44403df9
...
...
@@ -275,6 +275,7 @@ int audioMix(char *argv[]) {
filter_ctx
.
src_
};
int
i_
=
0
;
const
int
nb_inputs
=
2
;
while
(
1
)
{
...
...
@@ -293,18 +294,25 @@ int audioMix(char *argv[]) {
if
(
fin
[
i
]
==
1
)
{
add_to_src
(
audioContexts
[
i
],
srcs
[
i
],
NULL
,
NULL
);
}
else
{
add_to_src
(
audioContexts
[
i
],
srcs
[
i
],
packet
,
frame
);
}
add_to_src
(
audioContexts
[
i
],
srcs
[
i
],
packet
,
frame
);
av_packet_unref
(
packet
);
i_
=
i
;
}
}
// Get filtered frames
while
((
ret
=
av_buffersink_get_frame
(
filter_ctx
.
sink
,
frame
))
>=
0
)
{
process_filtered_frames
(
&
o_encoder
,
frame
);
av_frame_unref
(
frame
);
if
(
fin
[
i_
]
==
1
)
{
process_filtered_frames
(
&
o_encoder
,
NULL
);
}
else
{
// Get filtered frames
while
((
ret
=
av_buffersink_get_frame
(
filter_ctx
.
sink
,
frame
))
>=
0
)
{
process_filtered_frames
(
&
o_encoder
,
frame
);
av_frame_unref
(
frame
);
}
}
if
(
fin
[
0
]
==
1
&&
fin
[
1
]
==
1
)
{
...
...
@@ -682,5 +690,7 @@ char* mergeAV(char *videoPath, char *audio_1_path, char *audio_2_path) {
int
main
(
int
argc
,
char
*
argv
[])
{
mergeAV
(
argv
[
1
],
argv
[
2
],
argv
[
3
]);
audioMix
(
argv
);
//mergeAV(argv[1], argv[2], argv[3]);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment