生成片段化的mp4 ffmpeg,导致视频在bento4中的持续时间为0ms

问题描述

我使用ffmpeg使用以下命令生成片段化的mp4:

ffmpeg -re -i ./input.mp4 -g 52 \
-strict experimental -acodec aac -ab 64k -vcodec libx264 -vb 448k \
-f mp4 -movflags frag_keyframe+empty_moov \
./output.mp4

当我在HTMLMediaElement中播放video.duration = Infinity时。 当我用Bento4的mp4info检查文件时,得到:

File:
  major brand:      isom
  minor version:    200
  compatible brand: isom
  compatible brand: iso2
  compatible brand: avc1
  compatible brand: mp41
  fast start:       yes

Movie:
  duration:   612961 ms
  time scale: 1000
  fragments:  no

Found 2 Tracks
Track 1:
  flags:        3 ENABLED IN-MOVIE
  id:           1
  type:         Video
  duration: 0 ms
  language: und
  media:
    sample count: 15322
    timescale:    12800
    duration:     7844864 (media timescale units)
    duration:     612880 (ms)
    bitrate (computed): 2587.007 Kbps
[...]
Track 2:
  flags:        3 ENABLED IN-MOVIE
  id:           2
  type:         Audio
  duration: 0 ms
  language: eng
  media:
    sample count: 26398
    timescale:    44100
    duration:     27031552 (media timescale units)
    duration:     612960 (ms)
    bitrate (computed): 128.584 Kbps
[...]

有人知道我在做什么错吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...