How to get the speed of a Camera with Python?
On every sceneupdate we can call a function which checks for fcurves and then evaluate the current and previous frame.

The script creates a panel in the camera data section and displays the speed there.



import bpy

class CameraSpeedPanel(bpy.types.Panel):
    """Creates a Panel in the Data properties window
        when a camera is selected"""
    bl_label = "Camera Speed"
    bl_idname = "CAMERA_PT_speedometer"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "data"

    def draw(self, context):
        layout = self.layout

        cameras = [ob for ob in context.scene.objects if ob.type == 'CAMERA']

        for cam in cameras:
            print(cam.name)
            row = layout.row()
            lbl = cam.name
            if context.scene.camera == cam:
                lbl += ' (active)'
            if cam == context.scene.objects.active:
                row.label(lbl, icon = 'OUTLINER_OB_CAMERA')
            else:
                row.label(lbl, icon = 'CAMERA_DATA')
            row.label(self.getSpeed(context.scene, cam))

    def getSpeed(self, scene, ob):
        if (ob.animation_data == None or
            ob.animation_data.action == None):
            return '(not animated)'
        current = ob.location.copy()
        previous = ob.location.copy()
        frame = scene.frame_current
        for i in range(3):
            crv = ob.animation_data.action.fcurves.find('location', i)
            if (crv != None):
                current[i] = crv.evaluate(frame)
                previous[i] = crv.evaluate(frame - 1)
        output = str((current - previous).length)
        output = (output[:10] + '..') if len(output) &gt; 12 else output
        print(output)
        return output


def register():
    bpy.utils.register_class(CameraSpeedPanel)


def unregister():
    bpy.utils.unregister_class(CameraSpeedPanel)


if __name__ == "__main__":
    register()