Created
June 24, 2015 11:24
MP4の動画ファイルの再生時間を取得するワンライナー
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# http://qiita.com/takashisite/items/0eeb45c8bbd232e915dd | |
ffmpeg -i movie.mp4 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] }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment