Checking keyframe interval?

前端 未结 2 1742
傲寒
傲寒 2020-12-14 02:19

How can I check keyframe interval of a video file?

all I can see in ffmpeg output is:

  Metadata:
    metadatacreator : Yet Another Metadata Injector         


        
2条回答
  •  北海茫月
    2020-12-14 02:48

    The following command will give you the offsets of all key Frames in the Video

    ffprobe -show_frames -select_streams v:0 \
            -print_format csv Video.mov 2> /dev/null |
    stdbuf -oL cut -d ',' -f4 |
    grep -n 1 |
    stdbuf -oL cut -d ':' -f1
    

    Note that the command might respond a little late. Have patience :-)

    The ffprobe command gives you the frame level details in CSV format. Rest is a smart combination of cut and grep commands.

    cut -d ',' -f4
    

    filters the fourth column - this refers to the 'key_frame' flag.

    grep -n 1
    

    filters the key-frames only, and shows their line numbers in the CSV feed.

    The

    stdbuf -oL
    

    with the cut command manipulates the buffer of the cut command.

提交回复
热议问题