Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
3fb945a9
Commit
3fb945a9
authored
13 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
mpegpsenc: fix user specified mux rate
Fixes Ticket1175 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b717f35b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/mpegenc.c
+5
-2
5 additions, 2 deletions
libavformat/mpegenc.c
with
5 additions
and
2 deletions
libavformat/mpegenc.c
+
5
−
2
View file @
3fb945a9
...
...
@@ -65,6 +65,7 @@ typedef struct {
int
pack_header_freq
;
/* frequency (in packets^-1) at which we send pack headers */
int
system_header_freq
;
int
system_header_size
;
int
user_mux_rate
;
/* bitrate in units of bits/s */
int
mux_rate
;
/* bitrate in units of 50 bytes/s */
/* stream info */
int
audio_bound
;
...
...
@@ -423,7 +424,9 @@ static int mpeg_mux_init(AVFormatContext *ctx)
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
headers. XXX: compute it exactly */
bitrate
+=
bitrate
/
20
;
...
...
@@ -1237,7 +1240,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
#define OFFSET(x) offsetof(MpegMuxContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
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
},
{
NULL
},
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment