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
2c18893a
Commit
2c18893a
authored
Apr 20, 2011
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In libx264 wrapper, correctly support 2pass log filename option.
parent
b9553cf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
ffmpeg.c
ffmpeg.c
+9
-3
libx264.c
libavcodec/libx264.c
+13
-0
No files found.
ffmpeg.c
View file @
2c18893a
...
...
@@ -207,7 +207,7 @@ static int do_hex_dump = 0;
static
int
do_pkt_dump
=
0
;
static
int
do_psnr
=
0
;
static
int
do_pass
=
0
;
static
c
har
*
pass_logfilename_prefix
=
NULL
;
static
c
onst
char
*
pass_logfilename_prefix
;
static
int
audio_stream_copy
=
0
;
static
int
video_stream_copy
=
0
;
static
int
subtitle_stream_copy
=
0
;
...
...
@@ -2331,7 +2331,7 @@ static int transcode(AVFormatContext **output_files,
break
;
}
/* two pass mode */
if
(
ost
->
encoding_needed
&&
if
(
ost
->
encoding_needed
&&
codec
->
codec_id
!=
CODEC_ID_H264
&&
(
codec
->
flags
&
(
CODEC_FLAG_PASS1
|
CODEC_FLAG_PASS2
)))
{
char
logfilename
[
1024
];
FILE
*
f
;
...
...
@@ -4268,6 +4268,12 @@ static void log_callback_null(void* ptr, int level, const char* fmt, va_list vl)
{
}
static
void
opt_passlogfile
(
const
char
*
arg
)
{
pass_logfilename_prefix
=
arg
;
opt_default
(
"passlogfile"
,
arg
);
}
static
const
OptionDef
options
[]
=
{
/* main options */
#include "cmdutils_common_opts.h"
...
...
@@ -4341,7 +4347,7 @@ static const OptionDef options[] = {
{
"sameq"
,
OPT_BOOL
|
OPT_VIDEO
,
{(
void
*
)
&
same_quality
},
"use same quantizer as source (implies VBR)"
},
{
"pass"
,
HAS_ARG
|
OPT_FUNC2
|
OPT_VIDEO
,
{(
void
*
)
opt_pass
},
"select the pass number (1 or 2)"
,
"n"
},
{
"passlogfile"
,
HAS_ARG
|
OPT_
STRING
|
OPT_VIDEO
,
{(
void
*
)
&
pass_logfilename_prefix
},
"select two pass log file name prefix"
,
"prefix"
},
{
"passlogfile"
,
HAS_ARG
|
OPT_
VIDEO
,
{(
void
*
)
&
opt_passlogfile
},
"select two pass log file name prefix"
,
"prefix"
},
{
"deinterlace"
,
OPT_BOOL
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
do_deinterlace
},
"deinterlace pictures"
},
{
"psnr"
,
OPT_BOOL
|
OPT_EXPERT
|
OPT_VIDEO
,
{(
void
*
)
&
do_psnr
},
"calculate PSNR of compressed frames"
},
...
...
libavcodec/libx264.c
View file @
2c18893a
...
...
@@ -40,6 +40,7 @@ typedef struct X264Context {
const
char
*
profile
;
const
char
*
level
;
int
fastfirstpass
;
const
char
*
stats
;
}
X264Context
;
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
...
...
@@ -164,6 +165,15 @@ static av_cold int X264_close(AVCodecContext *avctx)
return
0
;
}
#define OPT_STR(opt, param) \
do { \
if (param && x264_param_parse(&x4->params, opt, param) < 0) { \
av_log(avctx, AV_LOG_ERROR, \
"bad value for '%s': '%s'\n", opt, param); \
return -1; \
} \
} while (0); \
#define OPT_STR(opt, param) \
do { \
if (param && x264_param_parse(&x4->params, opt, param) < 0) { \
...
...
@@ -291,6 +301,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
}
}
OPT_STR
(
"stats"
,
x4
->
stats
);
// if neither crf nor cqp modes are selected we have to enable the RC
// we do it this way because we cannot check if the bitrate has been set
if
(
!
(
avctx
->
crf
||
(
avctx
->
cqp
>
-
1
)))
...
...
@@ -371,6 +383,7 @@ static const AVOption options[] = {
{
"fastfirstpass"
,
"Use fast settings when encoding first pass"
,
OFFSET
(
fastfirstpass
),
FF_OPT_TYPE_INT
,
1
,
0
,
1
,
VE
},
{
"profile"
,
"Set profile restrictions"
,
OFFSET
(
profile
),
FF_OPT_TYPE_STRING
,
0
,
0
,
0
,
VE
},
{
"level"
,
"Specify level (as defined by Annex A)"
,
OFFSET
(
level
),
FF_OPT_TYPE_STRING
,
0
,
0
,
0
,
VE
},
{
"passlogfile"
,
"Filename for 2 pass stats"
,
OFFSET
(
stats
),
FF_OPT_TYPE_STRING
,
0
,
0
,
0
,
VE
},
{
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