From 2eb9a11263977d5a08f797128762ed5c0c2827ef Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Date: Fri, 20 Aug 2021 10:29:08 -0300 Subject: [PATCH] vid2mov: create script --- bin/vid2mov | 1 + vid2mov/README.md | 9 +++++++++ vid2mov/vid2mov.sh | 17 +++++++++++++++++ 3 files changed, 27 insertions(+) create mode 120000 bin/vid2mov create mode 100644 vid2mov/README.md create mode 100755 vid2mov/vid2mov.sh diff --git a/bin/vid2mov b/bin/vid2mov new file mode 120000 index 0000000..1289d32 --- /dev/null +++ b/bin/vid2mov @@ -0,0 +1 @@ +../vid2mov/vid2mov.sh \ No newline at end of file diff --git a/vid2mov/README.md b/vid2mov/README.md new file mode 100644 index 0000000..b514d89 --- /dev/null +++ b/vid2mov/README.md @@ -0,0 +1,9 @@ +# vid2mov + +## About +a simple script around ffmpeg to convert a video file to `.mov`. + +I personally use this script when I record something in OBS Studio and then want to import into DaVinci Resolve. + +## Requirements +- [ffmpeg](https://www.ffmpeg.org/) diff --git a/vid2mov/vid2mov.sh b/vid2mov/vid2mov.sh new file mode 100755 index 0000000..d433d15 --- /dev/null +++ b/vid2mov/vid2mov.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +VIDEO_PATH=$1 +[ "$VIDEO_PATH" = "" ] && echo "error: video_path not given" && exit 1 + +[ "$2" != "" ] && OUT_PATH=$2 || OUT_PATH=${VIDEO_PATH%%.*}.mov + +if ffmpeg -i "$VIDEO_PATH" -vcodec mpeg4 -q:v 2 -acodec pcm_s16le -q:a 0 -f mov "$OUT_PATH"; then + echo "Done" + notify-send "vid2mov" "$OUT_PATH done converting" + exit 0 +else + echo "Failed" + notify-send -u critical "vid2mov" "$OUT_PATH error while converting" + exit 1 +fi +