How to prevent lossy re-encode of low-bitrate videos uploaded to YouTube I have a huge number of low-res Flash videos (480x270, 30 fps, 800 Kbps) and I want to resample all those videos in 1280x720 with some added spatial sharpening and lomo filters to make them look nicer. I intend to store these larger videos on a HDD and also upload them on YouTube.

The total running time of the videos is around 50 days, so I'm not going to use a lossless codec. I experimented a bit and found that anything over 2 Mbps (H.264) didn't result in a noticeable increase in visual quality, which isn't surprising considering the tiny original resolution. 50 days at 2 Mbps is about 1 TB which would be great.

The problem is that YouTube seems hell-bent on re-encoding anything that is being uploaded regardless of the actual bitrate, so even though the local 1280x720 videos look great the uploaded 1280x720 videos look awful. I found some official recommended upload encoding settings but using those settings still results in compression artefacts.

How can I avoid the artefacts from YouTube's lossy re-encode without uploading videos of a significantly higher bitrate?

(I'm currently using Avidemux for resampling/re-encoding but from what I've read most people use Handbrake or MeGUI; should I switch or is Avidemux fine for my purposes?)
Youtube applies different maximum bitrates to different HD formats. A lot of people these days upscale their original 1080p HD content to 4k, since youtube allows higher datarate for 4k. Probably the same applies to 720p vs. 1080p, you should check. In general, you can optimize a video a lot so the same bitrate encoding will result in better quality, mainly by denoising it beforehand - or in you case, deblocking. I don't know if you are aquainted with AviSynth etc. but there are a couple of deblocking filters for it which might come in handy. From my experience there is no big difference if uploading a h264 with a high bitrate (like 25Mbps) or a ProRes file, after Youtube recompression quality is the same.