update
This commit is contained in:
26
ffmpeg_cut
Executable file
26
ffmpeg_cut
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if all required arguments are provided
|
||||
if [ $# -lt 4 ]; then
|
||||
echo "Usage: $0 <input_file> <output_file> <start_time> <duration>"
|
||||
echo ""
|
||||
echo "Arguments:"
|
||||
echo " <input_file> Path to the input video file."
|
||||
echo " <output_file> Path to the output video file."
|
||||
echo " <start_time> Start time in format HH:MM:SS or seconds."
|
||||
echo " <duration> Duration of the segment in format HH:MM:SS or seconds."
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " $0 input.mp4 output.mp4 00:01:00 30"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Assign input arguments to variables
|
||||
input_file=$1
|
||||
output_file=$2
|
||||
start_time=$3
|
||||
duration=$4
|
||||
|
||||
# Run ffmpeg command
|
||||
ffmpeg -i "$input_file" -ss "$start_time" -t "$duration" -vcodec copy -acodec copy "$output_file"
|
||||
Reference in New Issue
Block a user