Skip to content

Instantly share code, notes, and snippets.

@jeoliva
Last active December 13, 2022 07:47
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jeoliva/a3c4ef62b7f52926d0f339b395c0cd0c to your computer and use it in GitHub Desktop.
Save jeoliva/a3c4ef62b7f52926d0f339b395c0cd0c to your computer and use it in GitHub Desktop.
Get Keyframe interval (GOP size) of a stream/video using ffprobe
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]}'
@churu88
Copy link

churu88 commented Jul 23, 2018

Thanks mate, I don't know how it works every parameter but it works and I'm using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment