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
884f7c97
Commit
884f7c97
authored
Jul 23, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output example: set the stream timebase
This is required by the new API.
parent
d8520d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
output.c
doc/examples/output.c
+5
-2
No files found.
doc/examples/output.c
View file @
884f7c97
...
...
@@ -96,6 +96,8 @@ static void add_audio_stream(OutputStream *ost, AVFormatContext *oc,
c
->
channels
=
2
;
c
->
channel_layout
=
AV_CH_LAYOUT_STEREO
;
ost
->
st
->
time_base
=
(
AVRational
){
1
,
c
->
sample_rate
};
// some formats want stream headers to be separate
if
(
oc
->
oformat
->
flags
&
AVFMT_GLOBALHEADER
)
c
->
flags
|=
CODEC_FLAG_GLOBAL_HEADER
;
...
...
@@ -239,8 +241,9 @@ static void add_video_stream(OutputStream *ost, AVFormatContext *oc,
* of which frame timestamps are represented. For fixed-fps content,
* timebase should be 1/framerate and timestamp increments should be
* identical to 1. */
c
->
time_base
.
den
=
STREAM_FRAME_RATE
;
c
->
time_base
.
num
=
1
;
ost
->
st
->
time_base
=
(
AVRational
){
1
,
STREAM_FRAME_RATE
};
c
->
time_base
=
ost
->
st
->
time_base
;
c
->
gop_size
=
12
;
/* emit one intra frame every twelve frames at most */
c
->
pix_fmt
=
STREAM_PIX_FMT
;
if
(
c
->
codec_id
==
AV_CODEC_ID_MPEG2VIDEO
)
{
...
...
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