Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The command to use ffmpeg to directly convert H264 raw stream into an mp4 file is:

ffmpeg -f h264 -i input.h264 -c copy output.mp4

This command assumes that the input file is named "input.h264" and is located in the current working directory. The output file will be named "output.mp4" and will also be created in the current directory.

The "-f h264" option specifies the input format as H264, while the "-c copy" option specifies that the video and audio streams should be copied directly from the input file to the output file without any transcoding.

Note that if the input h264 raw stream does not contain audio, then the "-c copy" option can be omitted. Also, if the input file has a different format other than h264, then the "-f" option should be changed accordingly.