Miscellaneous script for my everyday usage.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conv-h265 478B

1234567891011121314151617
  1. #!/usr/bin/env zsh
  2. # Converts into H265/Opus with VA-API as .mkv.
  3. # Arg 1: Input file
  4. # Choose VA-API device and enable decoding acceleration
  5. # Encode video using x265 and default quality
  6. # Encode audio using Opus and 128k bitrate
  7. for file in ${@}
  8. do
  9. output_file=$( echo "$file" | sed -r "s/(\.[^\.]+)$/.conv.mkv/" )
  10. ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -i $file \
  11. -c:v libx265 -crf 28 \
  12. -c:a libopus -vbr:a on -b:a 128k $output_file
  13. done