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
ebd703f0
Commit
ebd703f0
authored
Aug 16, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/segment: deprecate "ext" format in favor of "csv"
The new option name is more descriptive.
parent
d8157635
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
muxers.texi
doc/muxers.texi
+9
-5
segment.c
libavformat/segment.c
+8
-2
No files found.
doc/muxers.texi
View file @
ebd703f0
...
@@ -490,9 +490,9 @@ The following values are recognized:
...
@@ -490,9 +490,9 @@ The following values are recognized:
@item flat
@item flat
Generate a flat list for the created segments, one segment per line.
Generate a flat list for the created segments, one segment per line.
@item ext
@item
csv,
ext
Generate a list for the created segments, one segment per line,
Generate a list for the created segments, one segment per line,
each line matching the format:
each line matching the format
(comma-separated values)
:
@example
@example
@var{segment_filename},@var{segment_start_time},@var{segment_end_time}
@var{segment_filename},@var{segment_start_time},@var{segment_end_time}
@end example
@end example
...
@@ -504,7 +504,11 @@ RFC4180) is applied if required.
...
@@ -504,7 +504,11 @@ RFC4180) is applied if required.
@var{segment_start_time} and @var{segment_end_time} specify
@var{segment_start_time} and @var{segment_end_time} specify
the segment start and end time expressed in seconds.
the segment start and end time expressed in seconds.
A list file with the suffix @code{".ext"} will auto-select this format.
A list file with the suffix @code{".csv"} or @code{".ext"} will
auto-select this format.
@code{ext} is deprecated in favor or @code{csv}.
@item m3u8
@item m3u8
Generate an extended M3U8 file, version 4, compliant with
Generate an extended M3U8 file, version 4, compliant with
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
@url{http://tools.ietf.org/id/draft-pantos-http-live-streaming-08.txt}.
...
@@ -559,7 +563,7 @@ ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nu
...
@@ -559,7 +563,7 @@ ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nu
As the example above, but segment the input file according to the split
As the example above, but segment the input file according to the split
points specified by the @var{segment_times} option:
points specified by the @var{segment_times} option:
@example
@example
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.
ext
-segment_times 1,2,3,5,8,13,21 out%03d.nut
ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.
csv
-segment_times 1,2,3,5,8,13,21 out%03d.nut
@end example
@end example
@item
@item
...
@@ -569,7 +573,7 @@ with the segment option @var{segment_time_delta} to account for
...
@@ -569,7 +573,7 @@ with the segment option @var{segment_time_delta} to account for
possible roundings operated when setting key frame times.
possible roundings operated when setting key frame times.
@example
@example
ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -vcodec mpeg4 -acodec pcm_s16le -map 0 \
ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -vcodec mpeg4 -acodec pcm_s16le -map 0 \
-f segment -segment_list out.
ext
-segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
-f segment -segment_list out.
csv
-segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
@end example
@end example
In order to force key frames on the input file, transcoding is
In order to force key frames on the input file, transcoding is
required.
required.
...
...
libavformat/segment.c
View file @
ebd703f0
...
@@ -39,11 +39,13 @@
...
@@ -39,11 +39,13 @@
typedef
enum
{
typedef
enum
{
LIST_TYPE_UNDEFINED
=
-
1
,
LIST_TYPE_UNDEFINED
=
-
1
,
LIST_TYPE_FLAT
=
0
,
LIST_TYPE_FLAT
=
0
,
LIST_TYPE_
EXT
,
LIST_TYPE_
CSV
,
LIST_TYPE_M3U8
,
LIST_TYPE_M3U8
,
LIST_TYPE_NB
,
LIST_TYPE_NB
,
}
ListType
;
}
ListType
;
#define LIST_TYPE_EXT LIST_TYPE_CSV
typedef
struct
{
typedef
struct
{
const
AVClass
*
class
;
/**< Class for private options. */
const
AVClass
*
class
;
/**< Class for private options. */
int
segment_idx
;
///< index of the segment file to write, starting from 0
int
segment_idx
;
///< index of the segment file to write, starting from 0
...
@@ -310,13 +312,16 @@ static int seg_write_header(AVFormatContext *s)
...
@@ -310,13 +312,16 @@ static int seg_write_header(AVFormatContext *s)
if
(
seg
->
list
)
{
if
(
seg
->
list
)
{
if
(
seg
->
list_type
==
LIST_TYPE_UNDEFINED
)
{
if
(
seg
->
list_type
==
LIST_TYPE_UNDEFINED
)
{
if
(
av_match_ext
(
seg
->
list
,
"ext"
))
seg
->
list_type
=
LIST_TYPE_EXT
;
if
(
av_match_ext
(
seg
->
list
,
"csv"
))
seg
->
list_type
=
LIST_TYPE_CSV
;
else
if
(
av_match_ext
(
seg
->
list
,
"ext"
))
seg
->
list_type
=
LIST_TYPE_EXT
;
else
if
(
av_match_ext
(
seg
->
list
,
"m3u8"
))
seg
->
list_type
=
LIST_TYPE_M3U8
;
else
if
(
av_match_ext
(
seg
->
list
,
"m3u8"
))
seg
->
list_type
=
LIST_TYPE_M3U8
;
else
seg
->
list_type
=
LIST_TYPE_FLAT
;
else
seg
->
list_type
=
LIST_TYPE_FLAT
;
}
}
if
((
ret
=
segment_list_open
(
s
))
<
0
)
if
((
ret
=
segment_list_open
(
s
))
<
0
)
goto
fail
;
goto
fail
;
}
}
if
(
seg
->
list_type
==
LIST_TYPE_EXT
)
av_log
(
s
,
AV_LOG_WARNING
,
"'ext' list type option is deprecated in favor of 'csv'
\n
"
);
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
seg
->
has_video
+=
seg
->
has_video
+=
...
@@ -445,6 +450,7 @@ static const AVOption options[] = {
...
@@ -445,6 +450,7 @@ static const AVOption options[] = {
{
"segment_list_size"
,
"set the maximum number of playlist entries"
,
OFFSET
(
list_size
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
E
},
{
"segment_list_size"
,
"set the maximum number of playlist entries"
,
OFFSET
(
list_size
),
AV_OPT_TYPE_INT
,
{.
dbl
=
0
},
0
,
INT_MAX
,
E
},
{
"segment_list_type"
,
"set the segment list type"
,
OFFSET
(
list_type
),
AV_OPT_TYPE_INT
,
{.
dbl
=
LIST_TYPE_UNDEFINED
},
-
1
,
LIST_TYPE_NB
-
1
,
E
,
"list_type"
},
{
"segment_list_type"
,
"set the segment list type"
,
OFFSET
(
list_type
),
AV_OPT_TYPE_INT
,
{.
dbl
=
LIST_TYPE_UNDEFINED
},
-
1
,
LIST_TYPE_NB
-
1
,
E
,
"list_type"
},
{
"flat"
,
"flat format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_FLAT
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"flat"
,
"flat format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_FLAT
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"csv"
,
"csv format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_CSV
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"ext"
,
"extended format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_EXT
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"ext"
,
"extended format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_EXT
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"m3u8"
,
"M3U8 format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_M3U8
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"m3u8"
,
"M3U8 format"
,
0
,
AV_OPT_TYPE_CONST
,
{.
dbl
=
LIST_TYPE_M3U8
},
INT_MIN
,
INT_MAX
,
0
,
"list_type"
},
{
"segment_time"
,
"set segment duration"
,
OFFSET
(
time_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
E
},
{
"segment_time"
,
"set segment duration"
,
OFFSET
(
time_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
E
},
...
...
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