视频文件:快进和快退不起作用
我有一些 flv 和 mp4 格式的视频剪辑,它们不能快进或快退到任意点(时间索引)。基本上每个视频剪辑都有 4 或 5 个位置,您可以向后或向前移动,但不能向前或向后移动到任意时间索引。我想知道是否有办法修改或转换视频,以便我可以前进或后退到视频剪辑上的任何时间索引。
感谢您的帮助
I have a few video clip in both flv and mp4 formats which don't fast forward or backward to arbitrary spots (time indexes). Basically each video clip has 4 or 5 spots to which you can backward or forward, but you can't forward or backward to arbitrary time indexes. I was wondering if there is anyway to modify or convert the videos so that I can forward or backward to any time index on the video clip.
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,您无法在 MP4 等视频文件格式中寻找任意时间位置。这是因为视频播放器依赖容器为可以随机访问的视频帧提供文件偏移量,并且只有某些帧符合资格。 (大多数视频帧无法自行解码,而是依赖于先前几帧的信息。)
但是,许多视频通过提供许多随机访问点来提供寻找任意时间位置的幻觉。换句话说,GOP 大小 保持较小(典型情况是每 1 秒出现一个关键帧),并且这些关键帧在 MP4 结构中引用。您的视频可能采用较大的 GOP 大小进行编码,因此它们的搜索点很少。
我怀疑,如果您使用 FFmpeg 等默认设置的工具对视频进行转码,您会发现它们比寻找时更有用。
In general, you can't seek to arbitrary time positions within a video file format such as MP4. This is because video players rely on the container to provide file offsets for video frames that can be random-accessed, and only certain frames qualify. (Most video frames cannot be decoded on their own, but rely on the information from several previous frames.)
However, many videos provide the illusion of seeking to arbitrary time positions by providing many random-access points. In other words, the GOP size is kept small (keyframes every 1 second is typical), and these keyframes are referenced in the MP4 structure. Your videos are probably encoded with large GOP sizes, so they have very few seek points.
I suspect that if you transcoded your videos using a tool such as FFmpeg with default settings, you'll find that they are much more usable when seeking.