Add All existing
This commit is contained in:
19
ffbitrate
Executable file
19
ffbitrate
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if the user provided a file as an argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <video_file>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the video file path from the argument
|
||||
VIDEO_FILE="$1"
|
||||
|
||||
# Use ffmpeg to extract the bitrate
|
||||
BITRATE=$(ffmpeg -i "$VIDEO_FILE" 2>&1 | grep -oP 'bitrate:\s+\K[\d.]+')
|
||||
|
||||
if [ -n "$BITRATE" ]; then
|
||||
echo "Bitrate: ${BITRATE} kb/s"
|
||||
else
|
||||
echo "Unable to retrieve bitrate."
|
||||
fi
|
||||
Reference in New Issue
Block a user