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
9cf5bcde
Commit
9cf5bcde
authored
Apr 27, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: accept + prefix to -pix_fmt option to disable automatic conversions.
parent
440af105
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
Changelog
Changelog
+1
-0
ffmpeg.texi
doc/ffmpeg.texi
+8
-0
ffmpeg.c
ffmpeg.c
+19
-0
No files found.
Changelog
View file @
9cf5bcde
...
...
@@ -29,6 +29,7 @@ version next:
- add libavresample audio conversion library for compatibility
- MicroDVD decoder
- Avid Meridien (AVUI) decoder
- accept + prefix to -pix_fmt option to disable automatic conversions.
version 0.10:
...
...
doc/ffmpeg.texi
View file @
9cf5bcde
...
...
@@ -418,6 +418,14 @@ also sources and sinks). This is an alias for @code{-filter:v}.
@item -pix
_
fmt[:@var
{
stream
_
specifier
}
] @var
{
format
}
(@emph
{
input/output,per-stream
}
)
Set pixel format. Use @code
{
-pix
_
fmts
}
to show all the supported
pixel formats.
If the selected pixel format can not be selected, ffmpeg will print a
warning and select the best pixel format supported by the encoder.
If @var
{
pix
_
fmt
}
is prefixed by a @code
{
+
}
, ffmpeg will exit with an error
if the requested pixel format can not be selected, and automatic conversions
inside filter graphs are disabled.
If @var
{
pix
_
fmt
}
is a single @code
{
+
}
, ffmpeg selects the same pixel format
as the input (or graph output) and automatic conversions are disabled.
@item -sws
_
flags @var
{
flags
}
(@emph
{
input/output
}
)
Set SwScaler flags.
@item -vdt @var
{
n
}
...
...
ffmpeg.c
View file @
9cf5bcde
...
...
@@ -319,6 +319,7 @@ typedef struct OutputStream {
int
copy_initial_nonkeyframes
;
enum
PixelFormat
pix_fmts
[
2
];
int
keep_pix_fmt
;
}
OutputStream
;
...
...
@@ -706,6 +707,15 @@ static enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum Pixe
static
char
*
choose_pixel_fmts
(
OutputStream
*
ost
)
{
if
(
ost
->
keep_pix_fmt
)
{
if
(
ost
->
filter
)
avfilter_graph_set_auto_convert
(
ost
->
filter
->
graph
->
graph
,
AVFILTER_AUTO_CONVERT_NONE
);
if
(
ost
->
st
->
codec
->
pix_fmt
==
PIX_FMT_NONE
)
return
NULL
;
ost
->
pix_fmts
[
0
]
=
ost
->
st
->
codec
->
pix_fmt
;
return
ost
->
pix_fmts
;
}
if
(
ost
->
st
->
codec
->
pix_fmt
!=
PIX_FMT_NONE
)
{
return
av_strdup
(
av_get_pix_fmt_name
(
choose_pixel_fmt
(
ost
->
st
,
ost
->
enc
,
ost
->
st
->
codec
->
pix_fmt
)));
}
else
if
(
ost
->
enc
->
pix_fmts
)
{
...
...
@@ -835,6 +845,10 @@ static int configure_video_filters(FilterGraph *fg)
return
ret
;
}
if
(
ost
->
keep_pix_fmt
)
avfilter_graph_set_auto_convert
(
fg
->
graph
,
AVFILTER_AUTO_CONVERT_NONE
);
if
((
ret
=
avfilter_graph_config
(
fg
->
graph
,
NULL
))
<
0
)
return
ret
;
...
...
@@ -4661,6 +4675,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
video_enc
->
bits_per_raw_sample
=
frame_bits_per_raw_sample
;
MATCH_PER_STREAM_OPT
(
frame_pix_fmts
,
str
,
frame_pix_fmt
,
oc
,
st
);
if
(
frame_pix_fmt
&&
*
frame_pix_fmt
==
'+'
)
{
ost
->
keep_pix_fmt
=
1
;
if
(
!*++
frame_pix_fmt
)
frame_pix_fmt
=
NULL
;
}
if
(
frame_pix_fmt
&&
(
video_enc
->
pix_fmt
=
av_get_pix_fmt
(
frame_pix_fmt
))
==
PIX_FMT_NONE
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Unknown pixel format requested: %s.
\n
"
,
frame_pix_fmt
);
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