Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo "FFmpeg Subtitle Burner Script"
- echo "============================="
- # Ask for input video file
- read -p "Enter input video file path: " input_video
- # Check if input video exists
- if [ ! -f "$input_video" ]; then
- echo "Error: Input video file '$input_video' not found!"
- exit 1
- fi
- # Ask for subtitle file
- read -p "Enter subtitle file path (.srt): " subtitle_file
- # Check if subtitle file exists
- if [ ! -f "$subtitle_file" ]; then
- echo "Error: Subtitle file '$subtitle_file' not found!"
- exit 1
- fi
- # Ask for output file
- read -p "Enter output file name: " output_file
- # Confirm the operation
- echo ""
- echo "Summary:"
- echo "Input video: $input_video"
- echo "Subtitle file: $subtitle_file"
- echo "Output file: $output_file"
- echo ""
- read -p "Proceed with burning subtitles? (y/N): " confirm
- if [[ $confirm != "y" && $confirm != "Y" ]]; then
- echo "Operation cancelled."
- exit 0
- fi
- echo "Starting subtitle burning process..."
- echo "This may take a while depending on video length..."
- # Run ffmpeg command
- ffmpeg -i "$input_video" -vf "subtitles=$subtitle_file" "$output_file"
- # Check if ffmpeg succeeded
- if [ $? -eq 0 ]; then
- echo ""
- echo "✅ Success! Subtitles burned to: $output_file"
- else
- echo ""
- echo "❌ Error: FFmpeg failed to process the video."
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment