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
f24facd3
Commit
f24facd3
authored
Sep 12, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: change av_log verbosity from ERROR to FATAL for fatal errors.
parent
1c5e9551
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
avconv.c
avconv.c
+24
-24
No files found.
avconv.c
View file @
f24facd3
...
@@ -549,7 +549,7 @@ static void assert_avoptions(AVDictionary *m)
...
@@ -549,7 +549,7 @@ static void assert_avoptions(AVDictionary *m)
{
{
AVDictionaryEntry
*
t
;
AVDictionaryEntry
*
t
;
if
((
t
=
av_dict_get
(
m
,
""
,
NULL
,
AV_DICT_IGNORE_SUFFIX
)))
{
if
((
t
=
av_dict_get
(
m
,
""
,
NULL
,
AV_DICT_IGNORE_SUFFIX
)))
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Option %s not found.
\n
"
,
t
->
key
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Option %s not found.
\n
"
,
t
->
key
);
exit_program
(
1
);
exit_program
(
1
);
}
}
}
}
...
@@ -560,12 +560,12 @@ static void assert_codec_experimental(AVCodecContext *c, int encoder)
...
@@ -560,12 +560,12 @@ static void assert_codec_experimental(AVCodecContext *c, int encoder)
AVCodec
*
codec
;
AVCodec
*
codec
;
if
(
c
->
codec
->
capabilities
&
CODEC_CAP_EXPERIMENTAL
&&
if
(
c
->
codec
->
capabilities
&
CODEC_CAP_EXPERIMENTAL
&&
c
->
strict_std_compliance
>
FF_COMPLIANCE_EXPERIMENTAL
)
{
c
->
strict_std_compliance
>
FF_COMPLIANCE_EXPERIMENTAL
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"%s '%s' is experimental and might produce bad "
av_log
(
NULL
,
AV_LOG_
FATAL
,
"%s '%s' is experimental and might produce bad "
"results.
\n
Add '-strict experimental' if you want to use it.
\n
"
,
"results.
\n
Add '-strict experimental' if you want to use it.
\n
"
,
codec_string
,
c
->
codec
->
name
);
codec_string
,
c
->
codec
->
name
);
codec
=
encoder
?
avcodec_find_encoder
(
c
->
codec
->
id
)
:
avcodec_find_decoder
(
c
->
codec
->
id
);
codec
=
encoder
?
avcodec_find_encoder
(
c
->
codec
->
id
)
:
avcodec_find_decoder
(
c
->
codec
->
id
);
if
(
!
(
codec
->
capabilities
&
CODEC_CAP_EXPERIMENTAL
))
if
(
!
(
codec
->
capabilities
&
CODEC_CAP_EXPERIMENTAL
))
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Or use the non experimental %s '%s'.
\n
"
,
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Or use the non experimental %s '%s'.
\n
"
,
codec_string
,
codec
->
name
);
codec_string
,
codec
->
name
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -2570,7 +2570,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
...
@@ -2570,7 +2570,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
*
sync
=
0
;
*
sync
=
0
;
sync_file_idx
=
strtol
(
sync
+
1
,
&
sync
,
0
);
sync_file_idx
=
strtol
(
sync
+
1
,
&
sync
,
0
);
if
(
sync_file_idx
>=
nb_input_files
||
sync_file_idx
<
0
)
{
if
(
sync_file_idx
>=
nb_input_files
||
sync_file_idx
<
0
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid sync file index: %d.
\n
"
,
sync_file_idx
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid sync file index: %d.
\n
"
,
sync_file_idx
);
exit_program
(
1
);
exit_program
(
1
);
}
}
if
(
*
sync
)
if
(
*
sync
)
...
@@ -2582,7 +2582,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
...
@@ -2582,7 +2582,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
break
;
break
;
}
}
if
(
i
==
input_files
[
sync_file_idx
].
nb_streams
)
{
if
(
i
==
input_files
[
sync_file_idx
].
nb_streams
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Sync stream specification in map %s does not "
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Sync stream specification in map %s does not "
"match any streams.
\n
"
,
arg
);
"match any streams.
\n
"
,
arg
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -2591,7 +2591,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
...
@@ -2591,7 +2591,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
file_idx
=
strtol
(
map
,
&
p
,
0
);
file_idx
=
strtol
(
map
,
&
p
,
0
);
if
(
file_idx
>=
nb_input_files
||
file_idx
<
0
)
{
if
(
file_idx
>=
nb_input_files
||
file_idx
<
0
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid input file index: %d.
\n
"
,
file_idx
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid input file index: %d.
\n
"
,
file_idx
);
exit_program
(
1
);
exit_program
(
1
);
}
}
if
(
negative
)
if
(
negative
)
...
@@ -2625,7 +2625,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
...
@@ -2625,7 +2625,7 @@ static int opt_map(OptionsContext *o, const char *opt, const char *arg)
}
}
if
(
!
m
)
{
if
(
!
m
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Stream map '%s' matches no streams.
\n
"
,
arg
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Stream map '%s' matches no streams.
\n
"
,
arg
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -2693,11 +2693,11 @@ static enum CodecID find_codec_or_die(const char *name, enum AVMediaType type, i
...
@@ -2693,11 +2693,11 @@ static enum CodecID find_codec_or_die(const char *name, enum AVMediaType type, i
avcodec_find_encoder_by_name
(
name
)
:
avcodec_find_encoder_by_name
(
name
)
:
avcodec_find_decoder_by_name
(
name
);
avcodec_find_decoder_by_name
(
name
);
if
(
!
codec
)
{
if
(
!
codec
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Unknown %s '%s'
\n
"
,
codec_string
,
name
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Unknown %s '%s'
\n
"
,
codec_string
,
name
);
exit_program
(
1
);
exit_program
(
1
);
}
}
if
(
codec
->
type
!=
type
)
{
if
(
codec
->
type
!=
type
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid %s type '%s'
\n
"
,
codec_string
,
name
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid %s type '%s'
\n
"
,
codec_string
,
name
);
exit_program
(
1
);
exit_program
(
1
);
}
}
return
codec
->
id
;
return
codec
->
id
;
...
@@ -2939,7 +2939,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
...
@@ -2939,7 +2939,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
double
qscale
=
-
1
;
double
qscale
=
-
1
;
if
(
!
st
)
{
if
(
!
st
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Could not alloc stream.
\n
"
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Could not alloc stream.
\n
"
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -2966,7 +2966,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
...
@@ -2966,7 +2966,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
if
(
next
=
strchr
(
bsf
,
','
))
if
(
next
=
strchr
(
bsf
,
','
))
*
next
++
=
0
;
*
next
++
=
0
;
if
(
!
(
bsfc
=
av_bitstream_filter_init
(
bsf
)))
{
if
(
!
(
bsfc
=
av_bitstream_filter_init
(
bsf
)))
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Unknown bitstream filter %s
\n
"
,
bsf
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Unknown bitstream filter %s
\n
"
,
bsf
);
exit_program
(
1
);
exit_program
(
1
);
}
}
if
(
bsfc_prev
)
if
(
bsfc_prev
)
...
@@ -3036,13 +3036,13 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
...
@@ -3036,13 +3036,13 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
MATCH_PER_STREAM_OPT
(
frame_rates
,
str
,
frame_rate
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
frame_rates
,
str
,
frame_rate
,
oc
,
st
);
if
(
frame_rate
&&
av_parse_video_rate
(
&
ost
->
frame_rate
,
frame_rate
)
<
0
)
{
if
(
frame_rate
&&
av_parse_video_rate
(
&
ost
->
frame_rate
,
frame_rate
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid framerate value: %s
\n
"
,
frame_rate
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid framerate value: %s
\n
"
,
frame_rate
);
exit_program
(
1
);
exit_program
(
1
);
}
}
MATCH_PER_STREAM_OPT
(
frame_sizes
,
str
,
frame_size
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
frame_sizes
,
str
,
frame_size
,
oc
,
st
);
if
(
frame_size
&&
av_parse_video_size
(
&
video_enc
->
width
,
&
video_enc
->
height
,
frame_size
)
<
0
)
{
if
(
frame_size
&&
av_parse_video_size
(
&
video_enc
->
width
,
&
video_enc
->
height
,
frame_size
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid frame size: %s.
\n
"
,
frame_size
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid frame size: %s.
\n
"
,
frame_size
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -3052,7 +3052,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
...
@@ -3052,7 +3052,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
MATCH_PER_STREAM_OPT
(
frame_pix_fmts
,
str
,
frame_pix_fmt
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
frame_pix_fmts
,
str
,
frame_pix_fmt
,
oc
,
st
);
if
(
frame_pix_fmt
&&
(
video_enc
->
pix_fmt
=
av_get_pix_fmt
(
frame_pix_fmt
))
==
PIX_FMT_NONE
)
{
if
(
frame_pix_fmt
&&
(
video_enc
->
pix_fmt
=
av_get_pix_fmt
(
frame_pix_fmt
))
==
PIX_FMT_NONE
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Unknown pixel format requested: %s.
\n
"
,
frame_pix_fmt
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Unknown pixel format requested: %s.
\n
"
,
frame_pix_fmt
);
exit_program
(
1
);
exit_program
(
1
);
}
}
st
->
sample_aspect_ratio
=
video_enc
->
sample_aspect_ratio
;
st
->
sample_aspect_ratio
=
video_enc
->
sample_aspect_ratio
;
...
@@ -3060,7 +3060,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
...
@@ -3060,7 +3060,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
MATCH_PER_STREAM_OPT
(
intra_matrices
,
str
,
intra_matrix
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
intra_matrices
,
str
,
intra_matrix
,
oc
,
st
);
if
(
intra_matrix
)
{
if
(
intra_matrix
)
{
if
(
!
(
video_enc
->
intra_matrix
=
av_mallocz
(
sizeof
(
*
video_enc
->
intra_matrix
)
*
64
)))
{
if
(
!
(
video_enc
->
intra_matrix
=
av_mallocz
(
sizeof
(
*
video_enc
->
intra_matrix
)
*
64
)))
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Could not allocate memory for intra matrix.
\n
"
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Could not allocate memory for intra matrix.
\n
"
);
exit_program
(
1
);
exit_program
(
1
);
}
}
parse_matrix_coeffs
(
video_enc
->
intra_matrix
,
intra_matrix
);
parse_matrix_coeffs
(
video_enc
->
intra_matrix
,
intra_matrix
);
...
@@ -3068,7 +3068,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
...
@@ -3068,7 +3068,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
MATCH_PER_STREAM_OPT
(
inter_matrices
,
str
,
inter_matrix
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
inter_matrices
,
str
,
inter_matrix
,
oc
,
st
);
if
(
inter_matrix
)
{
if
(
inter_matrix
)
{
if
(
!
(
video_enc
->
inter_matrix
=
av_mallocz
(
sizeof
(
*
video_enc
->
inter_matrix
)
*
64
)))
{
if
(
!
(
video_enc
->
inter_matrix
=
av_mallocz
(
sizeof
(
*
video_enc
->
inter_matrix
)
*
64
)))
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Could not allocate memory for inter matrix.
\n
"
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Could not allocate memory for inter matrix.
\n
"
);
exit_program
(
1
);
exit_program
(
1
);
}
}
parse_matrix_coeffs
(
video_enc
->
inter_matrix
,
inter_matrix
);
parse_matrix_coeffs
(
video_enc
->
inter_matrix
,
inter_matrix
);
...
@@ -3155,7 +3155,7 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc)
...
@@ -3155,7 +3155,7 @@ static OutputStream *new_audio_stream(OptionsContext *o, AVFormatContext *oc)
MATCH_PER_STREAM_OPT
(
sample_fmts
,
str
,
sample_fmt
,
oc
,
st
);
MATCH_PER_STREAM_OPT
(
sample_fmts
,
str
,
sample_fmt
,
oc
,
st
);
if
(
sample_fmt
&&
if
(
sample_fmt
&&
(
audio_enc
->
sample_fmt
=
av_get_sample_fmt
(
sample_fmt
))
==
AV_SAMPLE_FMT_NONE
)
{
(
audio_enc
->
sample_fmt
=
av_get_sample_fmt
(
sample_fmt
))
==
AV_SAMPLE_FMT_NONE
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid sample format '%s'
\n
"
,
sample_fmt
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid sample format '%s'
\n
"
,
sample_fmt
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -3406,7 +3406,7 @@ static void opt_output_file(void *optctx, const char *filename)
...
@@ -3406,7 +3406,7 @@ static void opt_output_file(void *optctx, const char *filename)
case
AVMEDIA_TYPE_SUBTITLE
:
ost
=
new_subtitle_stream
(
o
,
oc
);
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
ost
=
new_subtitle_stream
(
o
,
oc
);
break
;
case
AVMEDIA_TYPE_DATA
:
ost
=
new_data_stream
(
o
,
oc
);
break
;
case
AVMEDIA_TYPE_DATA
:
ost
=
new_data_stream
(
o
,
oc
);
break
;
default
:
default
:
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Cannot map stream #%d.%d - unsupported type.
\n
"
,
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Cannot map stream #%d.%d - unsupported type.
\n
"
,
map
->
file_index
,
map
->
stream_index
);
map
->
file_index
,
map
->
stream_index
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -3478,7 +3478,7 @@ static void opt_output_file(void *optctx, const char *filename)
...
@@ -3478,7 +3478,7 @@ static void opt_output_file(void *optctx, const char *filename)
break
;
break
;
}
}
}
else
{
}
else
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid input file index %d in chapter mapping.
\n
"
,
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid input file index %d in chapter mapping.
\n
"
,
o
->
chapters_input_file
);
o
->
chapters_input_file
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -3495,7 +3495,7 @@ static void opt_output_file(void *optctx, const char *filename)
...
@@ -3495,7 +3495,7 @@ static void opt_output_file(void *optctx, const char *filename)
#define METADATA_CHECK_INDEX(index, nb_elems, desc)\
#define METADATA_CHECK_INDEX(index, nb_elems, desc)\
if ((index) < 0 || (index) >= (nb_elems)) {\
if ((index) < 0 || (index) >= (nb_elems)) {\
av_log(NULL, AV_LOG_
ERROR
, "Invalid %s index %d while processing metadata maps\n",\
av_log(NULL, AV_LOG_
FATAL
, "Invalid %s index %d while processing metadata maps\n",\
(desc), (index));\
(desc), (index));\
exit_program(1);\
exit_program(1);\
}
}
...
@@ -3551,7 +3551,7 @@ static void opt_output_file(void *optctx, const char *filename)
...
@@ -3551,7 +3551,7 @@ static void opt_output_file(void *optctx, const char *filename)
val
=
strchr
(
o
->
metadata
[
i
].
u
.
str
,
'='
);
val
=
strchr
(
o
->
metadata
[
i
].
u
.
str
,
'='
);
if
(
!
val
)
{
if
(
!
val
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"No '=' character in metadata string %s.
\n
"
,
av_log
(
NULL
,
AV_LOG_
FATAL
,
"No '=' character in metadata string %s.
\n
"
,
o
->
metadata
[
i
].
u
.
str
);
o
->
metadata
[
i
].
u
.
str
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
@@ -3564,20 +3564,20 @@ static void opt_output_file(void *optctx, const char *filename)
...
@@ -3564,20 +3564,20 @@ static void opt_output_file(void *optctx, const char *filename)
break
;
break
;
case
's'
:
case
's'
:
if
(
index
<
0
||
index
>=
oc
->
nb_streams
)
{
if
(
index
<
0
||
index
>=
oc
->
nb_streams
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid stream index %d in metadata specifier.
\n
"
,
index
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid stream index %d in metadata specifier.
\n
"
,
index
);
exit_program
(
1
);
exit_program
(
1
);
}
}
m
=
&
oc
->
streams
[
index
]
->
metadata
;
m
=
&
oc
->
streams
[
index
]
->
metadata
;
break
;
break
;
case
'c'
:
case
'c'
:
if
(
index
<
0
||
index
>=
oc
->
nb_chapters
)
{
if
(
index
<
0
||
index
>=
oc
->
nb_chapters
)
{
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid chapter index %d in metadata specifier.
\n
"
,
index
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid chapter index %d in metadata specifier.
\n
"
,
index
);
exit_program
(
1
);
exit_program
(
1
);
}
}
m
=
&
oc
->
chapters
[
index
]
->
metadata
;
m
=
&
oc
->
chapters
[
index
]
->
metadata
;
break
;
break
;
default
:
default
:
av_log
(
NULL
,
AV_LOG_
ERROR
,
"Invalid metadata specifier %s.
\n
"
,
o
->
metadata
[
i
].
specifier
);
av_log
(
NULL
,
AV_LOG_
FATAL
,
"Invalid metadata specifier %s.
\n
"
,
o
->
metadata
[
i
].
specifier
);
exit_program
(
1
);
exit_program
(
1
);
}
}
...
...
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