Even if it had not wrongfully been closed as off-topic it could still be closed as
not a real question, the reason being that it is too vague. The only answer you could give would fit the conversion from any source format to any target format: Look at the specifications of both formats, think of an algorithm to map the header and an algorithm to convert the stream appropriately. Then apply those to the source file.
If at this point the question gets morphed into "what is the algorithm to do that?" you are again at
not a real question since this basically now is a code request without any prior effort.