Problem:
Don't know how to wait for encoding when handling pthread.
Solved and Progress:
Current in the script, it will call two encoders to encode the same content. And it works.
Muxer will search main path for output ts first and backup path for HA.