Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
f683895d
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f683895d
编写于
5月 25, 2013
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avformat/img2dec: support nanosecond file times
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
513a431e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
2 deletion
+18
-2
doc/demuxers.texi
doc/demuxers.texi
+2
-0
libavformat/img2dec.c
libavformat/img2dec.c
+16
-2
未找到文件。
doc/demuxers.texi
浏览文件 @
f683895d
...
...
@@ -265,6 +265,8 @@ is 5.
If set to 1, will set frame timestamp to modification time of image file. Note
that monotonity of timestamps is not provided: images go in the same order as
without this option. Default value is 0.
If set to 2, will set frame timestamp to the modification time of the image file in
nanosecond precission.
@item video_size
Set the video size of the images to read. If not specified the video
size is guessed from the first image file in the sequence.
...
...
libavformat/img2dec.c
浏览文件 @
f683895d
...
...
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _BSD_SOURCE
#include <sys/stat.h>
#include "libavutil/avstring.h"
#include "libavutil/log.h"
...
...
@@ -200,7 +201,13 @@ int ff_img_read_header(AVFormatContext *s1)
st
->
need_parsing
=
AVSTREAM_PARSE_FULL
;
}
if
(
s
->
ts_from_file
)
if
(
s
->
ts_from_file
==
2
)
{
#if !HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
av_log
(
s1
,
AV_LOG_ERROR
,
"POSIX.1-2008 not supported, nanosecond file timestamps unavailable
\n
"
);
return
AVERROR
(
ENOSYS
);
#endif
avpriv_set_pts_info
(
st
,
64
,
1
,
1000000000
);
}
else
if
(
s
->
ts_from_file
)
avpriv_set_pts_info
(
st
,
64
,
1
,
1
);
else
avpriv_set_pts_info
(
st
,
64
,
s
->
framerate
.
den
,
s
->
framerate
.
num
);
...
...
@@ -394,6 +401,10 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
if
(
stat
(
filename
,
&
img_stat
))
return
AVERROR
(
EIO
);
pkt
->
pts
=
(
int64_t
)
img_stat
.
st_mtime
;
#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
if
(
s
->
ts_from_file
==
2
)
pkt
->
pts
=
1000000000
*
pkt
->
pts
+
img_stat
.
st_mtim
.
tv_nsec
;
#endif
av_add_index_entry
(
s1
->
streams
[
0
],
s
->
img_number
,
pkt
->
pts
,
0
,
0
,
AVINDEX_KEYFRAME
);
}
else
if
(
!
s
->
is_pipe
)
{
pkt
->
pts
=
s
->
pts
;
...
...
@@ -468,7 +479,10 @@ static const AVOption options[] = {
{
"start_number_range"
,
"set range for looking at the first sequence number"
,
OFFSET
(
start_number_range
),
AV_OPT_TYPE_INT
,
{.
i64
=
5
},
1
,
INT_MAX
,
DEC
},
{
"video_size"
,
"set video size"
,
OFFSET
(
width
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
DEC
},
{
"frame_size"
,
"force frame size in bytes"
,
OFFSET
(
frame_size
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
DEC
},
{
"ts_from_file"
,
"set frame timestamp from file's one"
,
OFFSET
(
ts_from_file
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1
,
DEC
},
{
"ts_from_file"
,
"set frame timestamp from file's one"
,
OFFSET
(
ts_from_file
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
2
,
DEC
,
"ts_type"
},
{
"none"
,
"none"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
2
,
DEC
,
"ts_type"
},
{
"sec"
,
"second precission"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
2
,
DEC
,
"ts_type"
},
{
"ns"
,
"nano second precission"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
2
,
DEC
,
"ts_type"
},
{
NULL
},
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录