update
This commit is contained in:
39
ffmpeg_cut_tail
Executable file
39
ffmpeg_cut_tail
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if all required arguments are provided
|
||||
if [ $# -lt 3 ]; then
|
||||
echo "Usage: $0 <input_file> <output_file> <start_time>"
|
||||
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 ""
|
||||
echo "Example:"
|
||||
echo " $0 input.mp4 output.mp4 00:01:00"
|
||||
echo ""
|
||||
echo "Note: The output file will start from <start_time> and will include all remaining content of the input file."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Assign input arguments to variables
|
||||
input_file=$1
|
||||
output_file=$2
|
||||
start_time=$3
|
||||
|
||||
# Check if the input file exists
|
||||
if [ ! -f "$input_file" ]; then
|
||||
echo "Error: The input file '$input_file' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run the ffmpeg command
|
||||
ffmpeg -i "$input_file" -ss "$start_time" -vcodec copy -acodec copy "$output_file"
|
||||
|
||||
# Check if the ffmpeg command succeeded
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Video extraction completed successfully. Output saved to '$output_file'."
|
||||
else
|
||||
echo "Error: ffmpeg failed to extract the video."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user