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
b5e716ae
Commit
b5e716ae
authored
Jul 18, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mpegtsenc: Add sdt_period, similar to pat_period
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
34da54fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
muxers.texi
doc/muxers.texi
+2
-0
mpegtsenc.c
libavformat/mpegtsenc.c
+15
-1
No files found.
doc/muxers.texi
View file @
b5e716ae
...
@@ -761,6 +761,8 @@ Override the default PCR retransmission time (default 20ms), ignored
...
@@ -761,6 +761,8 @@ Override the default PCR retransmission time (default 20ms), ignored
if variable muxrate is selected.
if variable muxrate is selected.
@item pat_period @var{number}
@item pat_period @var{number}
Maximal time in seconds between PAT/PMT tables.
Maximal time in seconds between PAT/PMT tables.
@item sdt_period @var{number}
Maximal time in seconds between SDT tables.
@item -pes_payload_size @var{number}
@item -pes_payload_size @var{number}
Set minimum PES packet payload in bytes.
Set minimum PES packet payload in bytes.
@item -mpegts_flags @var{flags}
@item -mpegts_flags @var{flags}
...
...
libavformat/mpegtsenc.c
View file @
b5e716ae
...
@@ -103,7 +103,9 @@ typedef struct MpegTSWrite {
...
@@ -103,7 +103,9 @@ typedef struct MpegTSWrite {
int
copyts
;
int
copyts
;
int
tables_version
;
int
tables_version
;
float
pat_period
;
float
pat_period
;
float
sdt_period
;
int64_t
last_pat_ts
;
int64_t
last_pat_ts
;
int64_t
last_sdt_ts
;
int
omit_video_pes_length
;
int
omit_video_pes_length
;
}
MpegTSWrite
;
}
MpegTSWrite
;
...
@@ -787,10 +789,14 @@ static int mpegts_write_header(AVFormatContext *s)
...
@@ -787,10 +789,14 @@ static int mpegts_write_header(AVFormatContext *s)
}
}
ts
->
last_pat_ts
=
AV_NOPTS_VALUE
;
ts
->
last_pat_ts
=
AV_NOPTS_VALUE
;
ts
->
last_sdt_ts
=
AV_NOPTS_VALUE
;
// The user specified a period, use only it
// The user specified a period, use only it
if
(
ts
->
pat_period
<
INT_MAX
/
2
)
{
if
(
ts
->
pat_period
<
INT_MAX
/
2
)
{
ts
->
pat_packet_period
=
INT_MAX
;
ts
->
pat_packet_period
=
INT_MAX
;
}
}
if
(
ts
->
sdt_period
<
INT_MAX
/
2
)
{
ts
->
sdt_packet_period
=
INT_MAX
;
}
// output a PCR as soon as possible
// output a PCR as soon as possible
service
->
pcr_packet_count
=
service
->
pcr_packet_period
;
service
->
pcr_packet_count
=
service
->
pcr_packet_period
;
...
@@ -847,8 +853,13 @@ static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts)
...
@@ -847,8 +853,13 @@ static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts)
MpegTSWrite
*
ts
=
s
->
priv_data
;
MpegTSWrite
*
ts
=
s
->
priv_data
;
int
i
;
int
i
;
if
(
++
ts
->
sdt_packet_count
==
ts
->
sdt_packet_period
)
{
if
(
++
ts
->
sdt_packet_count
==
ts
->
sdt_packet_period
||
(
dts
!=
AV_NOPTS_VALUE
&&
ts
->
last_sdt_ts
==
AV_NOPTS_VALUE
)
||
(
dts
!=
AV_NOPTS_VALUE
&&
dts
-
ts
->
last_sdt_ts
>=
ts
->
sdt_period
*
90000
.
0
)
)
{
ts
->
sdt_packet_count
=
0
;
ts
->
sdt_packet_count
=
0
;
if
(
dts
!=
AV_NOPTS_VALUE
)
ts
->
last_sdt_ts
=
FFMAX
(
dts
,
ts
->
last_sdt_ts
);
mpegts_write_sdt
(
s
);
mpegts_write_sdt
(
s
);
}
}
if
(
++
ts
->
pat_packet_count
==
ts
->
pat_packet_period
||
if
(
++
ts
->
pat_packet_count
==
ts
->
pat_packet_period
||
...
@@ -1546,6 +1557,9 @@ static const AVOption options[] = {
...
@@ -1546,6 +1557,9 @@ static const AVOption options[] = {
{
"pat_period"
,
"PAT/PMT retransmission time limit in seconds"
,
{
"pat_period"
,
"PAT/PMT retransmission time limit in seconds"
,
offsetof
(
MpegTSWrite
,
pat_period
),
AV_OPT_TYPE_FLOAT
,
offsetof
(
MpegTSWrite
,
pat_period
),
AV_OPT_TYPE_FLOAT
,
{
.
dbl
=
INT_MAX
},
0
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
.
dbl
=
INT_MAX
},
0
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
"sdt_period"
,
"SDT retransmission time limit in seconds"
,
offsetof
(
MpegTSWrite
,
sdt_period
),
AV_OPT_TYPE_FLOAT
,
{
.
dbl
=
INT_MAX
},
0
,
INT_MAX
,
AV_OPT_FLAG_ENCODING_PARAM
},
{
NULL
},
{
NULL
},
};
};
...
...
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