Depends on where you live. In Germany any CCTV recording of a public place is automatically illegal. There’s a handful of exceptions (for example, for the parliament), but generally, this holds true.
Opt-in is what’s legally required, and should be the default.