Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
1948b76a
Commit
1948b76a
authored
Jan 24, 2018
by
Vishwanath Dixit
Committed by
Steven Liu
Jan 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hlsenc: closed caption tags in the master playlist
parent
8a4cc0a2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
196 additions
and
5 deletions
+196
-5
muxers.texi
doc/muxers.texi
+37
-0
dashenc.c
libavformat/dashenc.c
+1
-1
hlsenc.c
libavformat/hlsenc.c
+153
-2
hlsplaylist.c
libavformat/hlsplaylist.c
+4
-1
hlsplaylist.h
libavformat/hlsplaylist.h
+1
-1
No files found.
doc/muxers.texi
View file @
1948b76a
...
...
@@ -901,6 +901,43 @@ and they are mapped to the two video only variant streams with audio group names
By default, a single hls variant containing all the encoded streams is created.
@item cc_stream_map
Map string which specifies different closed captions groups and their
attributes. The closed captions stream groups are separated by space.
Expected string format is like this
"ccgroup:<group name>,instreamid:<INSTREAM-ID>,language:<language code> ....".
'ccgroup' and 'instreamid' are mandatory attributes. 'language' is an optional
attribute.
The closed captions groups configured using this option are mapped to different
variant streams by providing the same 'ccgroup' name in the
@code{var_stream_map} string. If @code{var_stream_map} is not set, then the
first available ccgroup in @code{cc_stream_map} is mapped to the output variant
stream. The examples for these two use cases are given below.
@example
ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
-cc_stream_map "ccgroup:cc,instreamid:CC1,language:en" \
-master_pl_name master.m3u8 \
http://example.com/live/out.m3u8
@end example
This example adds @code{#EXT-X-MEDIA} tag with @code{TYPE=CLOSED-CAPTIONS} in
the master playlist with group name 'cc', langauge 'en' (english) and
INSTREAM-ID 'CC1'. Also, it adds @code{CLOSED-CAPTIONS} attribute with group
name 'cc' for the output variant stream.
@example
ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
-a53cc:0 1 -a53cc:1 1\
-map 0:v -map 0:a -map 0:v -map 0:a -f hls \
-cc_stream_map "ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp" \
-var_stream_map "v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc" \
-master_pl_name master.m3u8 \
http://example.com/live/out_%v.m3u8
@end example
This example adds two @code{#EXT-X-MEDIA} tags with @code{TYPE=CLOSED-CAPTIONS} in
the master playlist for the INSTREAM-IDs 'CC1' and 'CC2'. Also, it adds
@code{CLOSED-CAPTIONS} attribute with group name 'cc' for the two output variant
streams.
@item master_pl_name
Create HLS master playlist with the given name.
...
...
libavformat/dashenc.c
View file @
1948b76a
...
...
@@ -820,7 +820,7 @@ static int write_manifest(AVFormatContext *s, int final)
stream_bitrate
+=
max_audio_bitrate
;
}
get_hls_playlist_name
(
playlist_file
,
sizeof
(
playlist_file
),
NULL
,
i
);
ff_hls_write_stream_info
(
st
,
out
,
stream_bitrate
,
playlist_file
,
agroup
,
NULL
);
ff_hls_write_stream_info
(
st
,
out
,
stream_bitrate
,
playlist_file
,
agroup
,
NULL
,
NULL
);
}
avio_close
(
out
);
if
(
use_rename
)
...
...
libavformat/hlsenc.c
View file @
1948b76a
This diff is collapsed.
Click to expand it.
libavformat/hlsplaylist.c
View file @
1948b76a
...
...
@@ -47,7 +47,8 @@ void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup,
void
ff_hls_write_stream_info
(
AVStream
*
st
,
AVIOContext
*
out
,
int
bandwidth
,
char
*
filename
,
char
*
agroup
,
char
*
codecs
)
{
char
*
codecs
,
char
*
ccgroup
)
{
if
(
!
out
||
!
filename
)
return
;
...
...
@@ -65,6 +66,8 @@ void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
avio_printf
(
out
,
",CODECS=
\"
%s
\"
"
,
codecs
);
if
(
agroup
&&
strlen
(
agroup
)
>
0
)
avio_printf
(
out
,
",AUDIO=
\"
group_%s
\"
"
,
agroup
);
if
(
ccgroup
&&
strlen
(
ccgroup
)
>
0
)
avio_printf
(
out
,
",CLOSED-CAPTIONS=
\"
%s
\"
"
,
ccgroup
);
avio_printf
(
out
,
"
\n
%s
\n\n
"
,
filename
);
}
...
...
libavformat/hlsplaylist.h
View file @
1948b76a
...
...
@@ -41,7 +41,7 @@ void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup,
char
*
filename
,
int
name_id
,
int
is_default
);
void
ff_hls_write_stream_info
(
AVStream
*
st
,
AVIOContext
*
out
,
int
bandwidth
,
char
*
filename
,
char
*
agroup
,
char
*
codecs
);
char
*
codecs
,
char
*
ccgroup
);
void
ff_hls_write_playlist_header
(
AVIOContext
*
out
,
int
version
,
int
allowcache
,
int
target_duration
,
int64_t
sequence
,
uint32_t
playlist_type
);
...
...
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