Compare commits

...

2 Commits

Author SHA1 Message Date
898d1976db Two new scripts to cut off the start or end 2023-12-18 22:30:59 +01:00
3fd84cace3 Replace spaces with tabs 2023-12-18 22:30:42 +01:00

View File

@ -37,7 +37,8 @@ function ff-mp4 () {
# Rename the original file and move the new mp4 file to its place # Rename the original file and move the new mp4 file to its place
mv -n "$file" "$dir/_$file_name" mv -n "$file" "$dir/_$file_name"
mv -n "$dir/temp_$name.mp4" "$dir/$file_name" mv -n "$dir/temp_$name.mp4" "$dir/$file_name"
done
done
} }
# Recompress input MP4 to 720p MP4 (copy audio) # Recompress input MP4 to 720p MP4 (copy audio)
@ -55,7 +56,7 @@ ff-recompress720p() {
echo "Conversion failed for: $input" echo "Conversion failed for: $input"
fi fi
fi fi
done done
} }
# ffmpeg-convert # ffmpeg-convert
@ -132,3 +133,19 @@ function ff-wma-m4a() {
mv "$dir/temp_$name.mp4" "$dir/$file"; mv "$dir/temp_$name.mp4" "$dir/$file";
done done
} }
## ffmpeg cut X seconds from start
function ff-cutstart {
local time="${2:-00:00:08.590}"
mv "$1" "_$1"
ffmpeg -ss $time -i "_$1" -map 0 -c copy -movflags faststart "$1"
}
## ffmpeg cut X seconds from start
function ff-cutend {
local time="${2:-24.250}"
duration=`ffprobe -v error -show_entries format=duration -of csv=p=0 "$1"`
duration=`bc --expression=$duration-$time`
mv "$1" "_$1"
ffmpeg -ss 00:00:00 -to $duration -i "_$1" -map 0 -c copy -movflags faststart "$1"
}