MP4 is an audio video container format, H264 is a video stream format with no audio.
To create a audio and video file, you need a container (MP4, MKV, etc.) which holds both and coordinates tham.
I'm not an ffmpeg expert, but I've used it a fair amount and foudn biost taht worked for me.
ffmpeg can extract streams from a file, and the
-c
switch tells it which stream type to extract:
-c:a
is audio,
-c:v
is video.
Once extracted, they can be combined into a MP4 file very easily:
Extract Audio stream:
ffmpeg -i GoodAudioInput.mp4 -c:a copy -vn -sn audio.m4a
Extract Video stream:
ffmpeg -i GoodVideoInput.mp4 -c:v copy -sn -an video.mp4
Merge the two:
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a aac -strict experimental merged.mp4
The
-c:a aac -strict experimental
part is to convert the audio to AAC and "magic stuff" that worked when I needed it to and I haven't experimented further to find out if I don't need it any more ...
If that doesn't do it, you probably need to visit an ffmpeg site, or talk to the camera manufacturer - this is a software development site, so you are lucky that anyone has a real clue about what you are doing!