Are you planning to store metadata in the mp4 container?
You can convert metadata to h264/5 sei, the store SEI to mp4 container. But this requires you to parse the mp4 file and extract the SEI.
Can you share your goals for doing so?
Refer to this topic
If your application is written by native code. Please refer to /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvdsmetautils/sei_serialization .
I think this is feasible. Each json file has the PTS and source id of the corresponding frame.