manipulating sound with video image brightness

hello

brand new and in need of some orientation.
Is there anything out there that can point me to doing some non-realtime manipulation of a video file?

I wan to input video, calculate its overall brightness and adjust its accompanying audio track based on that result

thanks

Lukas