diff --git a/_sync.sh b/_sync.sh index d368c29..fed666d 100755 --- a/_sync.sh +++ b/_sync.sh @@ -32,6 +32,7 @@ files=( "/usr/local/bin/scap:scap" "$HOME/docker.sh:docker.sh" "/usr/local/etc/X11/xinit/xinitrc.d/10-i3wm-kde-dark:X11/10-i3wm-kde-dark" + "$HOME/Videos/ffmpeg.sh:ffmpeg.sh" ) # create directories diff --git a/ffmpeg.sh b/ffmpeg.sh new file mode 100755 index 0000000..cc9a395 --- /dev/null +++ b/ffmpeg.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +input="$1" +output="$2" + +vaapi_device="/dev/dri/renderD128" +vaapi_codec="h264_vaapi" + +ffmpeg \ + -init_hw_device vaapi=foo:$vaapi_device \ + -hwaccel vaapi \ + -hwaccel_output_format vaapi \ + -hwaccel_device foo \ + -i "$input" \ + -filter_hw_device foo \ + -vf 'format=nv12|vaapi,hwupload' \ + -threads 4 \ + -c:v "$vaapi_codec" \ + -c:a aac \ + "$output"