문제

Is there any way to use common tools (ffmpeg? mplayer/mencoder? mkvmerge? etc) to find how often keyframes appear in a given video file? {and thereby finding the minimum seek size?} It seems like such an obvious statistic that there "must" be some common technique...

[if it helps, assume MKV container, H.264 video - I'd love to find a more general solution, but maybe that's not possible/practical?]

도움이 되었습니까?

해결책

There are many possible containers for multimedia data. Some are more amenable to your goal than others. Generally, it comes down to whether the format specifies an index that contains keyframe information. QuickTime/MOV/MP4 can do this since it has an atom/box names 'stss' (sample table, sync samples). I'm not too familiar with Matroska but I'm looking through the format spec as well as FFmpeg's demuxer for corroboration and there doesn't appear to be any such index. It looks like it would be necessary to parse through the frames and examine the keyframe flag for each.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top