I agree that media format endurance is likely to be a big issue - which means you'll need to move your "Time Capsule" to newer media as it becomes available.
You should also be careful about the format you store the data in. JPG is probably a pretty safe format because it's so widely used, but video formats are all over the place and I'm not sure how likely it is that you'll be able to find codecs for some of the more niche formats over 40 years from now. Remember that 40 years ago the only video tape that was available used industrial formats that consumers have never had access to and VHS was still 10 years in the future.
But ignoring all those issues, flash memory devices have a limit to how long they can retain data because the bits are stored as static charges which dissipate over time. It seems to be very difficult to get any solid information on how long you can expect the data in a flash memory device to last, but from my readings I've come to the conclusion that after 10 years you should start being concerned about retention.