Skip to content

Instantly share code, notes, and snippets.

@yatharthb97
Created May 29, 2023 16:09
Show Gist options
  • Save yatharthb97/36401e047da01b6464c954d219d74f77 to your computer and use it in GitHub Desktop.
Save yatharthb97/36401e047da01b6464c954d219d74f77 to your computer and use it in GitHub Desktop.
For counting the number of frames from a video file without reading the whole video in memory.
#On bash
ffprobe -v error -select_streams v:0 -count_packets \
-show_entries stream=nb_read_packets -of csv=p=0 <filename>
# On Jupyter
! ffprobe -v error -select_streams v:0 -count_packets \
-show_entries stream=nb_read_packets -of csv=p=0 {filename}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment