You can use ffprobe
:
ffprobe -i <file> -show_entries format=duration -v quiet -of csv="p=0"
It will output the duration in seconds, such as:
154.12
Adding the -sexagesimal
option will output duration as hours:minutes:seconds.microseconds:
00:02:34.12
More Related Contents:
- Syntax error: “(” unexpected — with !(*.sh) in bash script
- create a file with prefix =file1 followed by the random number
- How to read a file line by line and making a new file for each line having same filename as last word of each line? [closed]
- Why to code a script which will check if some package is installed in linux and if not then install it?
- Use sudo with password as parameter [closed]
- Shell script: Run function from script over ssh
- What is the difference between using `sh` and `source`?
- Given two directory trees, how can I find out which files differ by content? [closed]
- bash alias command with both single and double quotes
- Recursively look for files with a specific extension
- Take nth column in a text file
- Add a bash script to path
- Run multiple commands at once in the same terminal
- How to remove non UTF-8 characters from text file
- how to get MouseMove and MouseClick in bash?
- Find the files that have been changed in last 24 hours
- Tar a directory, but don’t store full absolute paths in the archive
- Bash script execution with and without shebang in Linux and BSD
- Variable in Bash Script that keeps it value from the last time running
- bash command not found when setting a variable
- How do I get cURL to not show the progress bar?
- Move all files except one
- Linux: remove file extensions for multiple files
- Joining multiple fields in text files on Unix
- Get yesterday’s date in bash on Linux, DST-safe
- find a pattern in files and rename them [closed]
- Linux shell script to add leading zeros to file names
- Need to remove the count from the output when using “uniq -c” command
- Negate if condition in bash script
- Creating temporary files in bash