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
3fb945a9
Commit
3fb945a9
authored
Apr 07, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegpsenc: fix user specified mux rate
Fixes Ticket1175 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b717f35b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
mpegenc.c
libavformat/mpegenc.c
+5
-2
No files found.
libavformat/mpegenc.c
View file @
3fb945a9
...
@@ -65,6 +65,7 @@ typedef struct {
...
@@ -65,6 +65,7 @@ typedef struct {
int
pack_header_freq
;
/* frequency (in packets^-1) at which we send pack headers */
int
pack_header_freq
;
/* frequency (in packets^-1) at which we send pack headers */
int
system_header_freq
;
int
system_header_freq
;
int
system_header_size
;
int
system_header_size
;
int
user_mux_rate
;
/* bitrate in units of bits/s */
int
mux_rate
;
/* bitrate in units of 50 bytes/s */
int
mux_rate
;
/* bitrate in units of 50 bytes/s */
/* stream info */
/* stream info */
int
audio_bound
;
int
audio_bound
;
...
@@ -423,7 +424,9 @@ static int mpeg_mux_init(AVFormatContext *ctx)
...
@@ -423,7 +424,9 @@ static int mpeg_mux_init(AVFormatContext *ctx)
video_bitrate
+=
codec_rate
;
video_bitrate
+=
codec_rate
;
}
}
if
(
!
s
->
mux_rate
)
{
if
(
s
->
user_mux_rate
)
{
s
->
mux_rate
=
(
s
->
user_mux_rate
+
(
8
*
50
)
-
1
)
/
(
8
*
50
);
}
else
{
/* we increase slightly the bitrate to take into account the
/* we increase slightly the bitrate to take into account the
headers. XXX: compute it exactly */
headers. XXX: compute it exactly */
bitrate
+=
bitrate
/
20
;
bitrate
+=
bitrate
/
20
;
...
@@ -1237,7 +1240,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
...
@@ -1237,7 +1240,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
#define OFFSET(x) offsetof(MpegMuxContext, x)
#define OFFSET(x) offsetof(MpegMuxContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
#define E AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
static
const
AVOption
options
[]
=
{
{
"muxrate"
,
NULL
,
OFFSET
(
mux_rate
),
AV_OPT_TYPE_INT
,
{
0
},
0
,
INT_MAX
,
E
},
{
"muxrate"
,
NULL
,
OFFSET
(
user_
mux_rate
),
AV_OPT_TYPE_INT
,
{
0
},
0
,
INT_MAX
,
E
},
{
"preload"
,
"Initial demux-decode delay in microseconds."
,
OFFSET
(
preload
),
AV_OPT_TYPE_INT
,
{
500000
},
0
,
INT_MAX
,
E
},
{
"preload"
,
"Initial demux-decode delay in microseconds."
,
OFFSET
(
preload
),
AV_OPT_TYPE_INT
,
{
500000
},
0
,
INT_MAX
,
E
},
{
NULL
},
{
NULL
},
};
};
...
...
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