Not sure if it quite fits the bill, but if your end user video uploads are stored on S3 or similar then zencoder does most of what you are looking for.
I came across this product recently: https://www.crowdsupply.com/gnubee/personal-cloud-1 which is seeking crowd funding at the moment. Personally I think they've made a mistake by going for 2.5" storage first with 3.5" coming later. Anyway, it sounds like it might be of interest to you?
This particular setup can/will leak cookies set on foo.tld to ads.foo.tld which leads to security concerns - only in your specific example though. If you were to use www.foo.tld and ads.foo.tld then you're good to go. While it is possible to carefully setup cookies that do not leak, its something you need to be careful of when recommending. That said, I do agree with your premise and wish native ad hosting like this happened much more often.