Skip to content

Instantly share code, notes, and snippets.

@mishazawa
Created February 21, 2019 07:54
Show Gist options
  • Select an option

  • Save mishazawa/9b36719e847f7a18b74d5140a4f572d4 to your computer and use it in GitHub Desktop.

Select an option

Save mishazawa/9b36719e847f7a18b74d5140a4f572d4 to your computer and use it in GitHub Desktop.
extract keyframes from video
# extract kframes
`ffmpeg -skip_frame nokey -i $filename -vsync 0 -r 30 -f image2 $output_dir-%02d.jpeg`
# get frames \ timestamps
`ls -1 image-*.jpeg > images.txt`
`ffprobe -f lavfi -i "movie=input.mp4,fps=fps=25[out0]" -show_frames -show_entries frame=pkt_pts_time -of csv=p=0 > frames.txt`
`paste images.txt frames.txt > combined.txt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment