diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-12-24 13:54:03 +0900 |
| commit | 28e8bdf7f8286bd431b7f3b709e79f3827b31469 (patch) | |
| tree | 85b44eff6da4d8443198fb6e04dfb6ee55244588 /debian/.local/bin/dvdburn | |
| parent | 8470ff001befcfd0f626dea69a9e76d43aee0511 (diff) | |
updates
Diffstat (limited to 'debian/.local/bin/dvdburn')
| -rwxr-xr-x | debian/.local/bin/dvdburn | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/.local/bin/dvdburn b/debian/.local/bin/dvdburn new file mode 100755 index 0000000..30993e1 --- /dev/null +++ b/debian/.local/bin/dvdburn @@ -0,0 +1,46 @@ +#!/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="$1" +fn="${input%.*}" +if [ ! -f "$input" ]; then + echo "Error: Input file '$input' not found." + exit 1 +fi + +# Set default VIDEO_FORMAT if not provided +export VIDEO_FORMAT="${VIDEO_FORMAT:-NTSC}" + +# 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 to DVD-Video format ($VIDEO_FORMAT)..." +format=$(printf '%s' "$VIDEO_FORMAT" | tr '[:upper:]' '[:lower:]') +ffmpeg -i "$input" -target "$format-dvd" -aspect 16:9 "$tmp_dir/$fn.mpg" + +# Create DVD file structure +echo "Creating DVD file structure..." +dvdauthor -o "$tmp_dir/dvd" -t "$tmp_dir/$fn.mpg" +dvdauthor -o "$tmp_dir/dvd" -T + +# Create ISO image from DVD structure +echo "Creating ISO image..." +mkisofs -dvd-video -o "$tmp_dir/$fn.iso" "$tmp_dir/dvd/" + +# Burn ISO image to DVD +echo "Burning DVD..." +wodim -v dev=/dev/sr0 speed=8 -eject "$tmp_dir/$fn.iso" + +# Cleanup +echo "Cleaning up..." +rm -rf "$tmp_dir" + +echo "Done!" |
