[FFmpeg-user] Difference between FFmpeg Formats/Containers MP4 and H264

Roger rogerx.oss at gmail.com
Sun May 15 18:59:34 EEST 2022

>> So when specifying, "-f h264", format is assuming a video only container?
>I'm not sure if container is the correct term here. It's just the video
>stream itself, which is capable of existing on its own outside of a
>container. Not many streams allow that. DV is one that comes to mind, where
>you can get raw DV streams which can even contain audio streams and other
>data streams interleaved. I've ran some tests and have not found a way to
>retain audio while using -f h264, it just retains a video stream. Maybe I'm
>doing something wrong?
>I can't think of many reasons why you would want standalone video streams
>outside of a container, so why not just use the mp4 or mkv format as it
>should have greater compatibility with playback tools?

Ah! I figured-out why "-f h264" worked for my past scenarios without apparent 
problems, the project contained only video, no audio!

And, likely omitting "-f h264" and only specifying the video/audio codecs for 
other video with audio projects.

Kind of a fluke my incanatation worked without apparent problems!

Glad I now have this ironed-out and am now correctly using ffmpeg for h264/mp4 

Always knew h264 was a codec, until seeing the "-f h264" option within ffmpeg 
manual.  Now I know "-f h264" for video only streams, likely security video 
without audio?


More information about the ffmpeg-user mailing list