Skip to content

Instantly share code, notes, and snippets.

@jeoliva
jeoliva / gist:a3c4ef62b7f52926d0f339b395c0cd0c
Last active Jun 16, 2021
Get Keyframe interval (GOP size) of a stream/video using ffprobe
View gist:a3c4ef62b7f52926d0f339b395c0cd0c
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]}'