We strongly discourage modifying files in /opt/local
manually and we do not support linking against your own pre-installed versions for the same reasons we discourage using /usr/local
(see wiki:FAQ#usrlocal).
If you need special copies of ffmpeg, x265 and x264, I suggest you create a local portfile repository (see https://guide.macports.org/#development.local-repositories) that contains Portfiles for these ports and modify the Portfiles to suit your needs.
We do not support forcing macports to use your custom built copy. As you've already noticed, you can skip the dependency.
Since we do not support this use-case, I will also not update the documentation to include it.