I'm in the process of building out an arduino based system that will switch the camera feeds on my trailer between the side and rear cameras based on which blinker is active at. I'm reading the blinker/brake input from the trailers wiring via a relay then feeding 5vdc + into a digital input to determine the state of the light.
The the problem I need to overcome is reading the difference between a blinker and a brake signal (same physical lamp/wire) and a blinker signal.
The two ways I've thought about determining the difference are looking for a pulse of less than one second (or a repeating pulse) that would indicate a blinker vs an input lasting more than a couple of seconds indicating a brake activation. The other way I can think of checking for the difference is to check the other blinker/brake circuit to see if it is active as well indicating a brake activation vs blinker.
Your vehicles must be wired different to ours if the brakes and indicators are the same.
I don't think the timing option will be reliable, as you have access to both sides I would test for them both being on as brakes, one on as indicator. That's also a lot easier then timing pulses.
Here in the UK I would always expect separate brake and indicator lamps so I'm not familiar with the setup you have, but I guess it may be similar to foreign vehicles I've seen where the indicators just blink one of the brake lamps. That means that braking and indicating together would give you one steady lamp and one flashing lamp. If that's what you have then you would just need to know the state of both lamps and monitor them to work out whether they were steady or flashing. If either lamp is on steady then the brakes are on. If either lamp is flashing then the indicator is on on that side. The corner case of the driver applying the brakes intermittently would need some logic to ensure that only one indicator or other could be flashing - if both seem to be flashing, it is either hazard lights or intermittent brake lights. I'm sure you could define an algorithm to tell those apart if it's something you expect to happen in your case.