Recently ran into a problem with YouTube's horrendous default video compression. I'm sure other TouchDesigner users have run into this problem before so I put together a blog post on my findings.
TL;DR: Be sure to upload files at least 2K (1440P) or above in resolution. This forces youtube to use a better codec (VP9 instead of AVC). You should also upload files at a higher bit-rate than youtube recomends for additional quality increase.
The full post with detailed screenshots and codec info can be found here: https://www.kephalosmusic.com/blog/video-production/youtube-compression/
It also includes a link to free software I found for AI upscaling videos, and a Machine Learning library for generating depth maps from 2D videos.