update
This commit is contained in:
15
2hevc
Executable file
15
2hevc
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
TMPFILE=$(mktemp)
|
||||
LOGFILE="/tmp/2hevc.log"
|
||||
|
||||
BITRATE=$(ffprobe -v error -select_streams v:0 -show_entries stream=bit_rate -of csv=p=0 "$1")
|
||||
|
||||
if [ "$(is_cuda)" == "ok!" ]; then
|
||||
echo "======== CUDA ========"
|
||||
time ffmpeg -y -hwaccel cuda -i "$1" -f mp4 -vcodec hevc_nvenc -acodec copy -b:v "$BITRATE" $TMPFILE
|
||||
else
|
||||
echo "======== VAPPI ========"
|
||||
time ffmpeg -y -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -i "$1" -f mp4 -vcodec hevc -acodec copy -b:v "$BITRATE" $TMPFILE
|
||||
fi
|
||||
|
||||
backup_and_replace "$1" "$TMPFILE" "$LOGFILE"
|
||||
Reference in New Issue
Block a user