This task would not be easy. First of all, there are hundreds of different types/codecs for video and audio, in order to convert them, the server must have these codecs installed (or the program for conversion must support them)
Second, I don't know any program that would be able decode all formats and then convert them into another (the program must have support for command line execution).
If you can find such program or a way do it, let us know