Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

视频解析时长为 0,导致无法预览图片 #53

Closed
027xiguapi opened this issue Mar 13, 2024 · 8 comments
Closed

视频解析时长为 0,导致无法预览图片 #53

027xiguapi opened this issue Mar 13, 2024 · 8 comments

Comments

@027xiguapi
Copy link

027xiguapi commented Mar 13, 2024

frag_bunny.mp4

ac5ccd768fe294e341b0d79f15ba3ea
如图 视频信息的 duration 为 0

image
duration 为 0,无法显示时长和预览图片
https://hughfenghen.github.io/WebAV/demo/1_4-mp4-previewer

@027xiguapi
Copy link
Author

用 @webav/av-recorder 录制的视频 也会出现同样的问题

@wslyh123
Copy link

总时长是videoTracks[0].duration除以videoTracks[0].timescale,不是那个duration。

@hughfenghen
Copy link
Member

用 @webav/av-recorder 录制的视频 也会出现同样的问题

@027xiguapi 参考 #20

@hughfenghen hughfenghen changed the title 视频解析问题 视频解析时长为 0 Mar 15, 2024
@027xiguapi
Copy link
Author

image
如果无法获取时长,就无法获取到关键帧,为了可以获取,我修改了源码

if (info.duration != 0 && time > info.duration / info.timescale)
      return null;

建议可以加上时长设置

@hughfenghen hughfenghen changed the title 视频解析时长为 0 视频解析时长为 0,导致无法预览图片 Mar 15, 2024
@hughfenghen hughfenghen reopened this Mar 15, 2024
@hughfenghen
Copy link
Member

image
问题在于,程序实际使用的是 videoTrack 下的 duration 字段,你期望的是 movie_duration 字段。

@hughfenghen
Copy link
Member

会在下个版本修复,将由最后一个 sample 决定时长,而不是从 moov 中读取时长信息

@hughfenghen
Copy link
Member

hughfenghen commented Mar 31, 2024

会在下个版本修复,将由最后一个 sample 决定时长,而不是从 moov 中读取时长信息

v0.4.0 已发布,查看 demo:https://bilibili.github.io/WebAV/demo/6_2-video-preview-cut
有问题再重开

@DeanDai
Copy link

DeanDai commented Jun 21, 2024

会在下个版本修复,将由最后一个 sample 决定时长,而不是从 moov 中读取时长信息

v0.4.0 已发布,查看 demo:https://hughfenghen.github.io/WebAV/demo/6_2-video-preview-cut 有问题再重开

Hi, seems like the demo is unavailable, may I know how to solve the issue? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants