https://gitlab.com/memeruiz/play-mpv-compress-h265
my-mpv -w 1980 -v 1080 -c mpv_conf_file -p playlist.m3u
killall ffmpeg; compress-h265 -d qsv -e hevc_qsv --ml nb.conf --delete --replace -y 1080 -c mpv_config_2020.08.19 -p list_2020.08.19.m3u -r report-`date +%s`
killall ffmpeg; compress-h265 -d cuda -e hevc_nvenc --ml nb.conf --delete --replace -y 1080 -c mpv_config_2020.08.19 -p list_2020.08.19.m3u -r report-`date +%s`
Remember that you can only use gpus that support h265 hardware accelerated compression: