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
4ee53d7e
Commit
4ee53d7e
authored
Aug 27, 2011
by
Joseph Wecker
Committed by
Michael Niedermayer
Sep 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flvenc: Correctly encode data stream into in-band metadata frames.
parent
4c050429
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
flvenc.c
libavformat/flvenc.c
+12
-4
No files found.
libavformat/flvenc.c
View file @
4ee53d7e
...
@@ -198,7 +198,7 @@ static int flv_write_header(AVFormatContext *s)
...
@@ -198,7 +198,7 @@ static int flv_write_header(AVFormatContext *s)
av_log
(
enc
,
AV_LOG_ERROR
,
"video codec not compatible with flv
\n
"
);
av_log
(
enc
,
AV_LOG_ERROR
,
"video codec not compatible with flv
\n
"
);
return
-
1
;
return
-
1
;
}
}
}
else
{
}
else
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
audio_enc
=
enc
;
audio_enc
=
enc
;
if
(
get_audio_flags
(
enc
)
<
0
)
if
(
get_audio_flags
(
enc
)
<
0
)
return
-
1
;
return
-
1
;
...
@@ -391,13 +391,18 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -391,13 +391,18 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
flags
|=
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
FLV_FRAME_KEY
:
FLV_FRAME_INTER
;
flags
|=
pkt
->
flags
&
AV_PKT_FLAG_KEY
?
FLV_FRAME_KEY
:
FLV_FRAME_INTER
;
}
else
{
}
else
if
(
enc
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
{
assert
(
enc
->
codec_type
==
AVMEDIA_TYPE_AUDIO
);
flags
=
get_audio_flags
(
enc
);
flags
=
get_audio_flags
(
enc
);
assert
(
size
);
assert
(
size
);
avio_w8
(
pb
,
FLV_TAG_TYPE_AUDIO
);
avio_w8
(
pb
,
FLV_TAG_TYPE_AUDIO
);
}
else
{
// In-band flv metadata ("scriptdata")
assert
(
enc
->
codec_type
==
AVMEDIA_TYPE_DATA
);
avio_w8
(
pb
,
FLV_TAG_TYPE_META
);
flags_size
=
0
;
flags
=
NULL
;
}
}
if
(
enc
->
codec_id
==
CODEC_ID_H264
||
enc
->
codec_id
==
CODEC_ID_MPEG4
)
{
if
(
enc
->
codec_id
==
CODEC_ID_H264
||
enc
->
codec_id
==
CODEC_ID_MPEG4
)
{
...
@@ -423,7 +428,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -423,7 +428,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_wb24
(
pb
,
ts
);
avio_wb24
(
pb
,
ts
);
avio_w8
(
pb
,(
ts
>>
24
)
&
0x7F
);
// timestamps are 32bits _signed_
avio_w8
(
pb
,(
ts
>>
24
)
&
0x7F
);
// timestamps are 32bits _signed_
avio_wb24
(
pb
,
flv
->
reserved
);
avio_wb24
(
pb
,
flv
->
reserved
);
avio_w8
(
pb
,
flags
);
if
(
flags_size
)
avio_w8
(
pb
,
flags
);
if
(
enc
->
codec_id
==
CODEC_ID_VP6
)
if
(
enc
->
codec_id
==
CODEC_ID_VP6
)
avio_w8
(
pb
,
0
);
avio_w8
(
pb
,
0
);
if
(
enc
->
codec_id
==
CODEC_ID_VP6F
)
if
(
enc
->
codec_id
==
CODEC_ID_VP6F
)
...
...
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