Multiple-channel PWM input on STM32
Instead of using two capture units to capture rising and falling edges separately, use a capture unit to react to both edges of the signal(s) and determine the state inside the interrupt handler.
Or use an external interrupt (pin-change) to react to either signal change and use a free-running timer to capture the counter value in software. If there is a lack of interrupts, you could OR (diodes) the signals to one interrupt input and check the source with regular inputs (one for each signal).