summaryrefslogtreecommitdiff
path: root/ar/.local/bin/dvdburn
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
commitc80a54e42b52ce297f0f2f71af23c562832025c7 (patch)
treedcce8bb977a770f473325d48f6f70b21d9818a40 /ar/.local/bin/dvdburn
init
Diffstat (limited to 'ar/.local/bin/dvdburn')
-rwxr-xr-xar/.local/bin/dvdburn44
1 files changed, 44 insertions, 0 deletions
diff --git a/ar/.local/bin/dvdburn b/ar/.local/bin/dvdburn
new file mode 100755
index 0000000..0e78b83
--- /dev/null
+++ b/ar/.local/bin/dvdburn
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# Check if input file is provided
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 input_video.mp4"
+ exit 1
+fi
+
+# Check if input file exists
+input_file="$1"
+if [ ! -f "$input_file" ]; then
+ echo "Error: Input file '$input_file' not found."
+ exit 1
+fi
+
+# Set default VIDEO_FORMAT if not provided
+VIDEO_FORMAT="${VIDEO_FORMAT:-PAL}"
+
+# Create temporary directory for DVD structure
+tmp_dir=$(mktemp -d)
+echo "Temporary directory created: $tmp_dir"
+
+# Convert MP4 to DVD-compatible MPEG-2 format
+echo "Converting $input_file to DVD-Video format ($VIDEO_FORMAT)..."
+ffmpeg -i "$input_file" -target "$VIDEO_FORMAT"-dvd -vf scale=720:576 -aspect 16:9 "$tmp_dir/video.mpg"
+
+# Create DVD file structure
+echo "Creating DVD file structure..."
+dvdauthor -o "$tmp_dir/dvd" -t "$tmp_dir/video.mpg"
+dvdauthor -o "$tmp_dir/dvd" -T
+
+# Create ISO image from DVD structure
+echo "Creating ISO image..."
+mkisofs -dvd-video -o "$tmp_dir/dvd.iso" "$tmp_dir/dvd/"
+
+# Burn ISO image to DVD
+echo "Burning DVD..."
+wodim -v dev=/dev/sr0 speed=8 -eject "$tmp_dir/dvd.iso"
+
+# Cleanup
+echo "Cleaning up..."
+rm -rf "$tmp_dir"
+
+echo "Done!"