Forked from jeoliva/gist:a3c4ef62b7f52926d0f339b395c0cd0c
Created
September 28, 2021 23:24
-
-
Save hugoleodev/31c5bdd5f89a6be118c332f3b2fb2173 to your computer and use it in GitHub Desktop.
Get Keyframe interval (GOP size) of a stream/video using ffprobe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffprobe -of compact -select_streams v -show_packets [VIDEO_FILE OR STREAM_URL] | grep K$ | awk 'BEGIN{FS="|";last=-1}{split($5,a,"="); if(last != -1) {print "Keframe pos: " a[2] ", Interval: " a[2]-last " seconds"} else {print "Keyframe: " a[2]}; last=a[2]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment