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
b8c310cb
Commit
b8c310cb
authored
Jan 04, 2012
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: support compressed formats
Let pass the codec name to -pixel_format and introduce -input_format.
parent
da2e774f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
v4l2.c
libavdevice/v4l2.c
+8
-3
No files found.
libavdevice/v4l2.c
View file @
b8c310cb
...
@@ -708,11 +708,15 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
...
@@ -708,11 +708,15 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
}
}
if
(
s
->
pixel_format
)
{
if
(
s
->
pixel_format
)
{
AVCodec
*
codec
=
avcodec_find_decoder_by_name
(
s
->
pixel_format
);
if
(
codec
)
s1
->
video_codec_id
=
codec
->
id
;
pix_fmt
=
av_get_pix_fmt
(
s
->
pixel_format
);
pix_fmt
=
av_get_pix_fmt
(
s
->
pixel_format
);
if
(
pix_fmt
==
PIX_FMT_NONE
)
{
if
(
pix_fmt
==
PIX_FMT_NONE
&&
!
codec
)
{
av_log
(
s1
,
AV_LOG_ERROR
,
"No such
pixel
format: %s.
\n
"
,
av_log
(
s1
,
AV_LOG_ERROR
,
"No such
input
format: %s.
\n
"
,
s
->
pixel_format
);
s
->
pixel_format
);
res
=
AVERROR
(
EINVAL
);
res
=
AVERROR
(
EINVAL
);
...
@@ -818,7 +822,8 @@ static const AVOption options[] = {
...
@@ -818,7 +822,8 @@ static const AVOption options[] = {
{
"standard"
,
"TV standard, used only by analog frame grabber"
,
OFFSET
(
standard
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"standard"
,
"TV standard, used only by analog frame grabber"
,
OFFSET
(
standard
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"channel"
,
"TV channel, used only by frame grabber"
,
OFFSET
(
channel
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
DEC
},
{
"channel"
,
"TV channel, used only by frame grabber"
,
OFFSET
(
channel
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
DEC
},
{
"video_size"
,
"A string describing frame size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"video_size"
,
"A string describing frame size, such as 640x480 or hd720."
,
OFFSET
(
video_size
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"pixel_format"
,
""
,
OFFSET
(
pixel_format
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"pixel_format"
,
"Preferred pixel format"
,
OFFSET
(
pixel_format
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"input_format"
,
"Preferred pixel format (for raw video) or codec name"
,
OFFSET
(
pixel_format
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"framerate"
,
""
,
OFFSET
(
framerate
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"list_formats"
,
"List available formats and exit"
,
OFFSET
(
list_format
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
DEC
,
"list_formats"
},
{
"list_formats"
,
"List available formats and exit"
,
OFFSET
(
list_format
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
DEC
,
"list_formats"
},
{
"all"
,
"Show all available formats"
,
OFFSET
(
list_format
),
AV_OPT_TYPE_CONST
,
{.
dbl
=
V4L_ALLFORMATS
},
0
,
INT_MAX
,
DEC
,
"list_formats"
},
{
"all"
,
"Show all available formats"
,
OFFSET
(
list_format
),
AV_OPT_TYPE_CONST
,
{.
dbl
=
V4L_ALLFORMATS
},
0
,
INT_MAX
,
DEC
,
"list_formats"
},
...
...
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