Problem sharing UE4 Skeleton

Hi. I’m trying to share UE4 skeleton with custom mesh, and in other hand applying custom BIP animation to UE4 mannequin.
Using the same hierarchy, no error on importing but skeletal meshes are going mad.
Some bones are rotating in the completely wrong direction when applying animations in UE.
Anyone has an idea to set biped to the right orientation ?
Note that retargeting works fine but I would like to share skeleton.