Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
594090c6
Commit
594090c6
authored
Dec 04, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: select best pixel format for the encoder if no exact match.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f88d5df3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
ffmpeg.c
ffmpeg.c
+5
-2
No files found.
ffmpeg.c
View file @
594090c6
...
@@ -764,6 +764,8 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
...
@@ -764,6 +764,8 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
{
{
if
(
codec
&&
codec
->
pix_fmts
){
if
(
codec
&&
codec
->
pix_fmts
){
const
enum
PixelFormat
*
p
=
codec
->
pix_fmts
;
const
enum
PixelFormat
*
p
=
codec
->
pix_fmts
;
int
has_alpha
=
av_pix_fmt_descriptors
[
st
->
codec
->
pix_fmt
].
nb_components
%
2
==
0
;
enum
PixelFormat
best
=
PIX_FMT_NONE
;
if
(
st
->
codec
->
strict_std_compliance
<=
FF_COMPLIANCE_UNOFFICIAL
){
if
(
st
->
codec
->
strict_std_compliance
<=
FF_COMPLIANCE_UNOFFICIAL
){
if
(
st
->
codec
->
codec_id
==
CODEC_ID_MJPEG
){
if
(
st
->
codec
->
codec_id
==
CODEC_ID_MJPEG
){
p
=
(
const
enum
PixelFormat
[]){
PIX_FMT_YUVJ420P
,
PIX_FMT_YUVJ422P
,
PIX_FMT_YUV420P
,
PIX_FMT_YUV422P
,
PIX_FMT_NONE
};
p
=
(
const
enum
PixelFormat
[]){
PIX_FMT_YUVJ420P
,
PIX_FMT_YUVJ422P
,
PIX_FMT_YUV420P
,
PIX_FMT_YUV422P
,
PIX_FMT_NONE
};
...
@@ -772,6 +774,7 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
...
@@ -772,6 +774,7 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
}
}
}
}
for
(;
*
p
!=
PIX_FMT_NONE
;
p
++
)
{
for
(;
*
p
!=
PIX_FMT_NONE
;
p
++
)
{
best
=
avcodec_find_best_pix_fmt2
(
best
,
*
p
,
st
->
codec
->
pix_fmt
,
has_alpha
,
NULL
);
if
(
*
p
==
st
->
codec
->
pix_fmt
)
if
(
*
p
==
st
->
codec
->
pix_fmt
)
break
;
break
;
}
}
...
@@ -781,8 +784,8 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
...
@@ -781,8 +784,8 @@ static void choose_pixel_fmt(AVStream *st, AVCodec *codec)
"Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'
\n
"
,
"Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'
\n
"
,
av_pix_fmt_descriptors
[
st
->
codec
->
pix_fmt
].
name
,
av_pix_fmt_descriptors
[
st
->
codec
->
pix_fmt
].
name
,
codec
->
name
,
codec
->
name
,
av_pix_fmt_descriptors
[
codec
->
pix_fmts
[
0
]
].
name
);
av_pix_fmt_descriptors
[
best
].
name
);
st
->
codec
->
pix_fmt
=
codec
->
pix_fmts
[
0
]
;
st
->
codec
->
pix_fmt
=
best
;
}
}
}
}
}
}
...
...
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