I would go with the optocoupler solution, followed by either a gate and a filter or by a retriggerable monostable to produce a clean HI or LOW from those 50/60Hz pulses.
Although less efficient, I would choose the resistor in series with the opto (don't forget the diode in antiparallel with the LED). The capacitor can cause high inrush currents that can damage the LED. It all depends on when the AC line is applied; so, if it's applied right at its peak, chances are the LED will get damaged.