[FFmpeg-trac] #9066(ffmpeg:new): Enable explicit output extension

FFmpeg trac at avcodec.org
Thu Jan 14 16:38:03 EET 2021


#9066: Enable explicit output extension
-------------------------------------+-------------------------------------
             Reporter:  tes45t       |                     Type:
                                     |  enhancement
               Status:  new          |                 Priority:  normal
            Component:  ffmpeg       |                  Version:  git-
             Keywords:  ffmpeg,      |  master
  output, file, extension, type,     |               Blocked By:
  format                             |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 I am making an application that uses FFmpeg to edit media files. The user
 selects input file, then selects output file and then selects extension.
 For example, user can do this:

 Input:     C:/path/to/video.mp4
 Output:    C:/path/to/edited.some-custom-extension
 Extension: "gif"

 Then my program invokes FFmpeg and passes arguments like this:

 ffmpeg -i "C:/path/to/video.mp4" <some_other_arguments_here>
 "C:/path/to/edited.some-custom-extension.gif"

 Notice the extra "gif" at the end. After FFmpeg exits, my program renames
 "edited.some-custom-extension.gif" to "edited.some-custom-extension".

 Basically, I want to be able to pass extension to ffmpeg as a separate
 argument, so that I do not need to rename the file after encoding. I am
 aware that there are already options for that (such as the -f option), but
 the string that needs to be passed to -f does not always match the file
 extension. For example, to encode as "flv", you need to pass "-f flv", but
 to encode as "mkv", you need to pass "-f matroska". I asked on stack
 exchange and they said that there is really missing the feature I am
 looking for.

 I would like either a mapping between file extensions and "-f" parameters
 (I am talking about output files, not input files; for input files FFmpeg
 can detect the format by file content and file extension is used just as
 fallback), or a new option that can override the extension (such that it
 would achieve the EXACT SAME effect as if the output file had that
 extension). For example, something like this:

 ffmpeg -i "C:/path/to/video.mp4" --explicit_extension "gif"
 "C:/path/to/edited.some-custom-extension"

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9066>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list