Using rotation matrix to set rotation of camera

Hi there, I am currently trying to write an import script for matchmoving data from boujou, since the only available script only works for version 2.49b. (https://pastebin.com/DipPGHt3, copyright belongs to blup1980). At this point, everything seems to work except the correct import of the camera rotation.

Boujou exports the camera data per frame, in the following form:

#R(0,0)    R(0,1)    R(0,2)    R(1,0)    R(1,1)    R(1,2)    R(2,0)    R(2,1)    R(2,2)    Tx    Ty    Tz    F(mm)
-0.000000000000    0.999936519779    -0.011267493639    0.221563900910    -0.010987449714    -0.975083952161    -0.975145854636    -0.002496469844    -0.221549835985    240.213647775196    9.968826043090    19.291635693283    13.708391

the first nine elements are the rotation matrix for the first frame, the next three the position, and the final one is the focal length of the exported camera.

in his blender 2.49b script, blup1980 creates and assigns this transformation matrix to a dummy camera, and copies the (implicitly transformed) rotation to the final camera, while doing some maths to the individual rotations:



- rotx.addBezier((numFrames+1, (tmpObj.RotX*18/3.141593)-18))
- roty.addBezier((numFrames+1, tmpObj.RotY*18/3.141593))
- rotz.addBezier((numFrames+1, tmpObj.RotZ*18/3.141593))


My problem ist, that blender 2.78 seems to handle this rotation data totally different than blender 2.49b does. I set up my rotation matrix, assigned it to the camera, and added a keyframe to the corresponding frame.
I transformed the matrix to Euler and quaternion and applied those to my camera while adding a keyframe.
I even exported the transformed camera data from blender 2.49b and used it to animate my camera in blender 2.78, but all of the results seem to have anything in common with the results I am getting in blender 2.49b.

If there is anyone, who has an idea on how these things work, I would be very happy if he or she could share it. Thanks.