Color corruption on resize when HW Transcoding HEVC content - Synology DS918+ NAS

Having dug into this, the breaking change seems to be that the input to the vaapi h264 encoder now looks like it has to be in nv12 format (previously it seemed to be okay to avoid the explicit surface format conversion).

Anyhow - since the single scale_vaapi format AND rescale seems to be broken, but either on their own seem fine - I’ve split the scale and format into two stages in the filter pipeline - and the world appears good again.

#!/bin/sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
declare -a new_args
forbidden_text=":format=nv12"
replacement_text="[0];[0]scale_vaapi=format=nv12"
for param in "$@"; do
  new_args+=("${param//$forbidden_text/$replacement_text}")
done

"${DIR}/Plex_Transcoder" "${new_args[@]}"
3 Likes