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
13c99587
Commit
13c99587
authored
Oct 13, 2011
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
segment: extend options
let set an alternate path for the segment files.
parent
1786c7f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
segment.c
libavformat/segment.c
+10
-5
No files found.
libavformat/segment.c
View file @
13c99587
...
...
@@ -32,10 +32,10 @@
typedef
struct
{
const
AVClass
*
class
;
/**< Class for private options. */
int
number
;
char
path
[
1024
];
AVFormatContext
*
avf
;
char
*
format
;
/**< Set by a private option. */
char
*
pattern
;
/**< Set by a private option. */
char
*
path
;
/**< Set by a private option. */
float
time
;
/**< Set by a private option. */
int64_t
offset_time
;
int64_t
recording_time
;
...
...
@@ -96,7 +96,12 @@ static int seg_write_header(AVFormatContext *s)
seg
->
recording_time
=
seg
->
time
*
1000000
;
seg
->
offset_time
=
0
;
av_strlcpy
(
seg
->
path
,
"test"
,
sizeof
(
"test"
));
if
(
!
seg
->
path
)
{
char
*
t
;
seg
->
path
=
strdup
(
s
->
filename
);
t
=
rindex
(
seg
->
path
,
'.'
);
if
(
t
)
t
=
'\0'
;
}
oc
=
avformat_alloc_context
();
...
...
@@ -184,10 +189,10 @@ static int seg_write_trailer(struct AVFormatContext *s)
#define OFFSET(x) offsetof(SegmentContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"container_format"
,
"container format used for the segments"
,
OFFSET
(
format
),
FF_OPT_TYPE_STRING
,
{.
str
=
"nut"
},
0
,
0
,
E
},
{
"segment_time"
,
"segment lenght in seconds"
,
OFFSET
(
time
),
FF_OPT_TYPE_FLOAT
,
{.
dbl
=
2
},
0
,
FLT_MAX
,
E
},
{
"container_format"
,
"container format used for the segments"
,
OFFSET
(
format
),
FF_OPT_TYPE_STRING
,
{.
str
=
"nut"
},
0
,
0
,
E
},
{
"segment_time"
,
"segment lenght in seconds"
,
OFFSET
(
time
),
FF_OPT_TYPE_FLOAT
,
{.
dbl
=
2
},
0
,
FLT_MAX
,
E
},
{
"segment_pattern"
,
"pattern to use in segment files"
,
OFFSET
(
pattern
),
FF_OPT_TYPE_STRING
,
{.
str
=
"%03d"
},
0
,
0
,
E
},
{
"segment_basename"
,
"basename to use in segment files"
,
OFFSET
(
pattern
),
FF_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
E
},
{
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