Skip to content

Instantly share code, notes, and snippets.

@UdaraAlwis
Last active December 7, 2019 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UdaraAlwis/d830d88790a7307de79047460c6235a2 to your computer and use it in GitHub Desktop.
Save UdaraAlwis/d830d88790a7307de79047460c6235a2 to your computer and use it in GitHub Desktop.
Get Video file Playback time using ffprobe
:: Make sure ffprobe.exe and the video file is in the same folder
:: Download ffmpeg: https://www.ffmpeg.org/download.html
:: Command Line executable code
:: Get video length of a given mp4 file using ffprobe.exe
:: 0:01:01.812000
:: HOURS:MM:SS.MICROSECONDS
ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 video_file_name.mp4 -sexagesimal
:: Get video length of a given mp4 files (loop through files)
for %i in ("*.mp4") do ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "%i" -sexagesimal
:: integrate to executable .bat file - use %%
for %%a in ("*.mp4") do ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "%%a" -sexagesimal
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment