mirror of
https://github.com/GRFreire/scripts.git
synced 2026-01-09 04:49:38 +00:00
vid2mov: add optional dependency notify-send
This commit is contained in:
parent
2eb9a11263
commit
928d5d8304
@ -7,3 +7,4 @@ I personally use this script when I record something in OBS Studio and then want
|
||||
|
||||
## Requirements
|
||||
- [ffmpeg](https://www.ffmpeg.org/)
|
||||
- [notify-send](https://gitlab.gnome.org/GNOME/libnotify) (optional)
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
notify() {
|
||||
if [ "$(command -v notify-send)" ]; then
|
||||
notify-send "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
VIDEO_PATH=$1
|
||||
[ "$VIDEO_PATH" = "" ] && echo "error: video_path not given" && exit 1
|
||||
|
||||
@ -7,11 +13,11 @@ VIDEO_PATH=$1
|
||||
|
||||
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"
|
||||
notify "vid2mov" "$OUT_PATH done converting"
|
||||
exit 0
|
||||
else
|
||||
echo "Failed"
|
||||
notify-send -u critical "vid2mov" "$OUT_PATH error while converting"
|
||||
notify -u critical "vid2mov" "$OUT_PATH error while converting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user