Primary and Secondary stream from two encoders redundancy ?

I have two Encoders with the same source and i want to use the first stream as primary and the second as backup.

How can i do that ? How to redundant between two streams?