Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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.wasm-core
Commits
d497141b
Commit
d497141b
authored
Jan 10, 2014
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples/muxing: simplify video PTS setting
Rely on frame_count. Also more consistent with audio path.
parent
2ce45432
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
muxing.c
doc/examples/muxing.c
+1
-3
No files found.
doc/examples/muxing.c
View file @
d497141b
...
...
@@ -435,6 +435,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st)
av_init_packet
(
&
pkt
);
/* encode the image */
frame
->
pts
=
frame_count
;
ret
=
avcodec_encode_video2
(
c
,
&
pkt
,
frame
,
&
got_packet
);
if
(
ret
<
0
)
{
fprintf
(
stderr
,
"Error encoding video frame: %s
\n
"
,
av_err2str
(
ret
));
...
...
@@ -549,8 +550,6 @@ int main(int argc, char **argv)
return
1
;
}
if
(
frame
)
frame
->
pts
=
0
;
for
(;;)
{
/* Compute current audio and video time. */
audio_time
=
audio_st
?
audio_st
->
pts
.
val
*
av_q2d
(
audio_st
->
time_base
)
:
0
.
0
;
...
...
@@ -565,7 +564,6 @@ int main(int argc, char **argv)
write_audio_frame
(
oc
,
audio_st
);
}
else
{
write_video_frame
(
oc
,
video_st
);
frame
->
pts
++
;
}
}
...
...
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