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
7a67ab5c
Commit
7a67ab5c
authored
Aug 27, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg_opt: reduce diff to libav in opt_target() by 16 lines
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2082c00e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
ffmpeg_opt.c
ffmpeg_opt.c
+26
-26
No files found.
ffmpeg_opt.c
View file @
7a67ab5c
...
...
@@ -2221,19 +2221,19 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option
(
o
,
"s"
,
norm
==
PAL
?
"352x288"
:
"352x240"
,
options
);
parse_option
(
o
,
"r"
,
frame_rates
[
norm
],
options
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:v"
,
"1150000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"maxrate"
,
"1150000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"minrate"
,
"1150000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"bufsize"
,
"327680"
,
AV_DICT_DONT_OVERWRITE
);
// 40*1024*8;
opt_default
(
NULL
,
"b:v"
,
"1150000"
);
opt_default
(
NULL
,
"maxrate"
,
"1150000"
);
opt_default
(
NULL
,
"minrate"
,
"1150000"
);
opt_default
(
NULL
,
"bufsize"
,
"327680"
);
// 40*1024*8;
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:a"
,
"224000"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"b:a"
,
"224000"
);
parse_option
(
o
,
"ar"
,
"44100"
,
options
);
parse_option
(
o
,
"ac"
,
"2"
,
options
);
av_dict_set
(
&
o
->
g
->
format_opts
,
"packetsize"
,
"2324"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
format_opts
,
"muxrate"
,
"1411200"
,
AV_DICT_DONT_OVERWRITE
);
// 2352 * 75 * 8;
opt_default
(
NULL
,
"packetsize"
,
"2324"
);
opt_default
(
NULL
,
"muxrate"
,
"1411200"
);
// 2352 * 75 * 8;
/* We have to offset the PTS, so that it is consistent with the SCR.
SCR starts at 36000, but the first two packs contain only padding
...
...
@@ -2250,18 +2250,18 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option
(
o
,
"s"
,
norm
==
PAL
?
"480x576"
:
"480x480"
,
options
);
parse_option
(
o
,
"r"
,
frame_rates
[
norm
],
options
);
parse_option
(
o
,
"pix_fmt"
,
"yuv420p"
,
options
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:v"
,
"2040000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"maxrate"
,
"2516000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"minrate"
,
"0"
,
AV_DICT_DONT_OVERWRITE
);
// 1145000;
av_dict_set
(
&
o
->
g
->
codec_opts
,
"bufsize"
,
"1835008"
,
AV_DICT_DONT_OVERWRITE
);
// 224*1024*8;
av_dict_set
(
&
o
->
g
->
codec_opts
,
"scan_offset"
,
"1"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"b:v"
,
"2040000"
);
opt_default
(
NULL
,
"maxrate"
,
"2516000"
);
opt_default
(
NULL
,
"minrate"
,
"0"
);
// 1145000;
opt_default
(
NULL
,
"bufsize"
,
"1835008"
);
// 224*1024*8;
opt_default
(
NULL
,
"scan_offset"
,
"1"
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:a"
,
"224000"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"b:a"
,
"224000"
);
parse_option
(
o
,
"ar"
,
"44100"
,
options
);
av_dict_set
(
&
o
->
g
->
format_opts
,
"packetsize"
,
"2324"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"packetsize"
,
"2324"
);
}
else
if
(
!
strcmp
(
arg
,
"dvd"
))
{
...
...
@@ -2272,17 +2272,17 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option
(
o
,
"s"
,
norm
==
PAL
?
"720x576"
:
"720x480"
,
options
);
parse_option
(
o
,
"r"
,
frame_rates
[
norm
],
options
);
parse_option
(
o
,
"pix_fmt"
,
"yuv420p"
,
options
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"g"
,
norm
==
PAL
?
"15"
:
"18"
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:v"
,
"6000000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"maxrate"
,
"9000000"
,
AV_DICT_DONT_OVERWRITE
);
av_dict_set
(
&
o
->
g
->
codec_opts
,
"minrate"
,
"0"
,
AV_DICT_DONT_OVERWRITE
);
// 1500000;
av_dict_set
(
&
o
->
g
->
codec_opts
,
"bufsize"
,
"1835008"
,
AV_DICT_DONT_OVERWRITE
);
// 224*1024*8;
opt_default
(
NULL
,
"b:v"
,
"6000000"
);
opt_default
(
NULL
,
"maxrate"
,
"9000000"
);
opt_default
(
NULL
,
"minrate"
,
"0"
);
// 1500000;
opt_default
(
NULL
,
"bufsize"
,
"1835008"
);
// 224*1024*8;
av_dict_set
(
&
o
->
g
->
format_opts
,
"packetsize"
,
"2048"
,
AV_DICT_DONT_OVERWRITE
);
// from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
av_dict_set
(
&
o
->
g
->
format_opts
,
"muxrate"
,
"10080000"
,
AV_DICT_DONT_OVERWRITE
);
// from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
opt_default
(
NULL
,
"packetsize"
,
"2048"
);
// from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
opt_default
(
NULL
,
"muxrate"
,
"10080000"
);
// from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
av_dict_set
(
&
o
->
g
->
codec_opts
,
"b:a"
,
"448000"
,
AV_DICT_DONT_OVERWRITE
);
opt_default
(
NULL
,
"b:a"
,
"448000"
);
parse_option
(
o
,
"ar"
,
"48000"
,
options
);
}
else
if
(
!
strncmp
(
arg
,
"dv"
,
2
))
{
...
...
@@ -2302,8 +2302,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
return
AVERROR
(
EINVAL
);
}
av_dict_copy
(
&
o
->
g
->
codec_opts
,
codec_opts
,
0
);
av_dict_copy
(
&
o
->
g
->
format_opts
,
format_opts
,
0
);
av_dict_copy
(
&
o
->
g
->
codec_opts
,
codec_opts
,
AV_DICT_DONT_OVERWRITE
);
av_dict_copy
(
&
o
->
g
->
format_opts
,
format_opts
,
AV_DICT_DONT_OVERWRITE
);
return
0
;
}
...
...
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