How to convert .h264 files into mp4 container

Hello,

due to the lag of the video playback within the voicemail function, I would like to convert the messagexxxx.h264 files together with the .gsm files into mp4 containers to be playable with e.g. vlc player.

When I try to use ffmpeg to put the raw h264 into an mp4 container (as a start), I get only errors and not streams are found:

ffmpeg -i msg0017.h264 -vcodec h264 -acodec aac output.mp4

h264 @ 0x56032133f180] Format h264 detected only with low score of 1, misdetection possible!
[h264 @ 0x560321340d00] missing picture in access unit with size 7805550
[extract_extradata @ 0x560321341380] No start code is found.
msg0017.h264: could not find codec parameters
Input #0, h264, from ‘msg0017.h264’:
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264, none, 1200k tbn
Output #0, mp4, to ‘output.mp4’:
Output file #0 does not contain any stream

What did I do wrong please?

If by “.h264” you mean file generated by format_h264 then this is simple data format but specific to asterisk (you probably would need to look into source code). You have to extract RTP payload from it and convert it to H264 Elementary Stream. See RFC 6184.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.