Is possible to edit mediainfo of a file or create a default?

I would like to know if it is possible to edit/set mediainfo from media files from one of the cases below.

1- I create an empty file and set the mediainfo of it before it gets the media content.

2- I have a partial file(during the process of writing the media to a file) and would like to edit the mediainfo of this file.