LoginSignup
4
4

More than 5 years have passed since last update.

ffmpegを使ってディレクトリ内の全mp4ファイルのdurationを秒で取得する

Posted at
for i in *.mp4; do ffmpeg -i $i 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }'; done
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4