Search code examples
javajavafxffmpeg

What are all of the file extensions supported by FFmpeg


How would I go about getting a list of all the file extensions supported by FFmpeg for use in an ExtensionFilter used by FileChooser in JavaFX?

I am familiar with the "-codecs" and "-formats" options from FFmpeg, but these list the format and codec names which do not necessarily coincide with their file extensions.

e.g. (partial output from "ffmpeg -formats")

  • D aac raw ADTS AAC (Advanced Audio Coding)
  • DE ac3 raw AC-3
  • E matroska Matroska

parsing aac and ac3 from the output of ffmpeg would work fine to create file extensions for those types of files, but matroska has ".mkv" file extension.


Solution

  • There's no list directly available. You'll have to run

    for input formats, ffmpeg -demuxers
    for output formats, ffmpeg -muxers

    Then for each entry, run

    for input formats, ffmpeg -h demuxer=entry
    for output formats, ffmpeg -h muxer=entry

    Each format readout will show something like,

    Muxer matroska [Matroska]:
        Common extensions: mkv.
        Mime type: video/x-matroska.
        Default video codec: h264.
    ...
    

    or

    Demuxer avi [AVI (Audio Video Interleaved)]:
        Common extensions: avi.
    ...
    

    Then you can collect all extensions from the Common extensions entries.