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
a9c1545a
Commit
a9c1545a
authored
Jul 15, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpegtsenc: support storing PAT/PMT per frame
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
e3e4f175
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
muxers.texi
doc/muxers.texi
+2
-0
mpegtsenc.c
libavformat/mpegtsenc.c
+9
-0
No files found.
doc/muxers.texi
View file @
a9c1545a
...
...
@@ -810,6 +810,8 @@ Option mpegts_flags may take a set of such flags:
Reemit PAT/PMT before writing the next packet.
@item latm
Use LATM packetization for AAC.
@item pat_pmt_at_frames
Reemit PAT and PMT at each video frame.
@end table
@subsection Example
...
...
libavformat/mpegtsenc.c
View file @
a9c1545a
...
...
@@ -98,6 +98,7 @@ typedef struct MpegTSWrite {
int
pcr_period
;
#define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01
#define MPEGTS_FLAG_AAC_LATM 0x02
#define MPEGTS_FLAG_PAT_PMT_AT_FRAMES 0x04
int
flags
;
int
copyts
;
int
tables_version
;
...
...
@@ -971,6 +972,11 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
int64_t
delay
=
av_rescale
(
s
->
max_delay
,
90000
,
AV_TIME_BASE
);
int
force_pat
=
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
key
&&
!
ts_st
->
prev_payload_key
;
av_assert0
(
ts_st
->
payload
!=
buf
||
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
);
if
(
ts
->
flags
&
MPEGTS_FLAG_PAT_PMT_AT_FRAMES
&&
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
force_pat
=
1
;
}
is_start
=
1
;
while
(
payload_size
>
0
)
{
retransmit_si_info
(
s
,
force_pat
);
...
...
@@ -1505,6 +1511,9 @@ static const AVOption options[] = {
{
"latm"
,
"Use LATM packetization for AAC"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
MPEGTS_FLAG_AAC_LATM
},
0
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
,
"mpegts_flags"
},
{
"pat_pmt_at_frames"
,
"Reemit PAT and PMT at each video frame"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
MPEGTS_FLAG_PAT_PMT_AT_FRAMES
},
0
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
,
"mpegts_flags"
},
// backward compatibility
{
"resend_headers"
,
"Reemit PAT/PMT before writing the next packet"
,
offsetof
(
MpegTSWrite
,
reemit_pat_pmt
),
AV_OPT_TYPE_INT
,
...
...
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