FFmpeg can output metadata into a plain txt file, as described here.
I don't think that it's a particularly widely-supported format, but it's pretty amenable to regex (one tag per line, with the tag and its contents separated by an '='). For example, to grab the title metadata, you could use something like:
## Extract metadata to metadata.txt
ffmpeg -i input.mp4 -f ffmetadata metadata.txt
## Take metadata from metadata.txt and add it to input.mp4,
## creating output.mp4
ffmpeg -i input.mp4 -f ffmetadata -i metadata.txt -c copy -map_metadata 1 output.mp4
sed -n '/title=/s/.*=\(.*$\)/\1/p' metadata.txt