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
454c89dd
Commit
454c89dd
authored
Jul 18, 2013
by
Ramiro Polla
Committed by
Michael Niedermayer
Jul 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
img2enc: add option to use strftime() for filename
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
fc6de70c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
img2enc.c
libavformat/img2enc.c
+11
-0
No files found.
libavformat/img2enc.c
View file @
454c89dd
...
...
@@ -37,6 +37,7 @@ typedef struct {
int
split_planes
;
/**< use independent file for each Y, U, V plane */
char
path
[
1024
];
int
update
;
int
use_strftime
;
}
VideoMuxData
;
static
int
write_header
(
AVFormatContext
*
s
)
...
...
@@ -77,6 +78,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if
(
!
img
->
is_pipe
)
{
if
(
img
->
update
)
{
av_strlcpy
(
filename
,
img
->
path
,
sizeof
(
filename
));
}
else
if
(
img
->
use_strftime
)
{
time_t
now0
;
struct
tm
*
tm
;
time
(
&
now0
);
tm
=
localtime
(
&
now0
);
if
(
!
strftime
(
filename
,
sizeof
(
filename
),
img
->
path
,
tm
))
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not get frame filename with strftime
\n
"
);
return
AVERROR
(
EINVAL
);
}
}
else
if
(
av_get_frame_filename
(
filename
,
sizeof
(
filename
),
img
->
path
,
img
->
img_number
)
<
0
&&
img
->
img_number
>
1
)
{
av_log
(
s
,
AV_LOG_ERROR
,
...
...
@@ -133,6 +143,7 @@ static const AVOption muxoptions[] = {
{
"updatefirst"
,
"continuously overwrite one file"
,
OFFSET
(
update
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
ENC
},
{
"update"
,
"continuously overwrite one file"
,
OFFSET
(
update
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
ENC
},
{
"start_number"
,
"set first number in the sequence"
,
OFFSET
(
img_number
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
1
,
INT_MAX
,
ENC
},
{
"strftime"
,
"use strftime for filename"
,
OFFSET
(
use_strftime
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
1
,
ENC
},
{
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