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
ea2de3d0
Commit
ea2de3d0
authored
Feb 13, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/concatdec: add the "duration" directive.
parent
b92c7a8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
demuxers.texi
doc/demuxers.texi
+7
-0
concatdec.c
libavformat/concatdec.c
+15
-0
No files found.
doc/demuxers.texi
View file @
ea2de3d0
...
...
@@ -56,6 +56,8 @@ following directive is recognized:
Path to a file to read; special characters and spaces must be escaped with
backslash or single quotes.
All subsequent directives apply to that file.
@item @code{ffconcat version 1.0}
Identify the script type and version. It also sets the @option{safe} option
to 1 if it was to its default -1.
...
...
@@ -64,6 +66,11 @@ To make FFmpeg recognize the format automatically, this directive must
appears exactly as is (no extra space or byte-order-mark) on the very first
line of the script.
@item @code{duration @var{dur}}
Duration of the file. This information can be specified from the file;
specifying it here may be more efficient or help if the information from the
file is not available or accurate.
@end table
@subsection Options
...
...
libavformat/concatdec.c
View file @
ea2de3d0
...
...
@@ -20,6 +20,7 @@
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "internal.h"
...
...
@@ -174,6 +175,20 @@ static int concat_read_header(AVFormatContext *avf)
}
if
((
ret
=
add_file
(
avf
,
filename
,
&
file
,
&
nb_files_alloc
))
<
0
)
FAIL
(
ret
);
}
else
if
(
!
strcmp
(
keyword
,
"duration"
))
{
char
*
dur_str
=
get_keyword
(
&
cursor
);
int64_t
dur
;
if
(
!
file
)
{
av_log
(
avf
,
AV_LOG_ERROR
,
"Line %d: duration without file
\n
"
,
line
);
FAIL
(
AVERROR_INVALIDDATA
);
}
if
((
ret
=
av_parse_time
(
&
dur
,
dur_str
,
1
))
<
0
)
{
av_log
(
avf
,
AV_LOG_ERROR
,
"Line %d: invalid duration '%s'
\n
"
,
line
,
dur_str
);
FAIL
(
ret
);
}
file
->
duration
=
dur
;
}
else
if
(
!
strcmp
(
keyword
,
"ffconcat"
))
{
char
*
ver_kw
=
get_keyword
(
&
cursor
);
char
*
ver_val
=
get_keyword
(
&
cursor
);
...
...
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