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
8e12f09a
Commit
8e12f09a
authored
May 10, 2020
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/ivfenc: add an AVOutputFormat.init() function
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
7a92147f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ivfenc.c
libavformat/ivfenc.c
+11
-2
No files found.
libavformat/ivfenc.c
View file @
8e12f09a
...
...
@@ -26,10 +26,9 @@ typedef struct IVFEncContext {
uint64_t
last_pts
,
sum_delta_pts
;
}
IVFEncContext
;
static
int
ivf_
write_header
(
AVFormatContext
*
s
)
static
int
ivf_
init
(
AVFormatContext
*
s
)
{
AVCodecParameters
*
par
;
AVIOContext
*
pb
=
s
->
pb
;
if
(
s
->
nb_streams
!=
1
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Format supports only exactly one video stream
\n
"
);
...
...
@@ -43,6 +42,15 @@ static int ivf_write_header(AVFormatContext *s)
av_log
(
s
,
AV_LOG_ERROR
,
"Currently only VP8, VP9 and AV1 are supported!
\n
"
);
return
AVERROR
(
EINVAL
);
}
return
0
;
}
static
int
ivf_write_header
(
AVFormatContext
*
s
)
{
AVCodecParameters
*
par
=
s
->
streams
[
0
]
->
codecpar
;
AVIOContext
*
pb
=
s
->
pb
;
avio_write
(
pb
,
"DKIF"
,
4
);
avio_wl16
(
pb
,
0
);
// version
avio_wl16
(
pb
,
32
);
// header length
...
...
@@ -119,6 +127,7 @@ AVOutputFormat ff_ivf_muxer = {
.
extensions
=
"ivf"
,
.
audio_codec
=
AV_CODEC_ID_NONE
,
.
video_codec
=
AV_CODEC_ID_VP8
,
.
init
=
ivf_init
,
.
write_header
=
ivf_write_header
,
.
write_packet
=
ivf_write_packet
,
.
write_trailer
=
ivf_write_trailer
,
...
...
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