[FFmpeg-user] mapping formats to file extensions and MIME types

Ofer Nave odigity at gmail.com
Sun May 21 16:18:37 EEST 2017


On Sun, May 21, 2017 at 5:48 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
wrote:

> You can disable the text demuxer at build time or you can
> use the global -format_whitelist option to only allow formats
> that you want (without needing any processing).


Good to know - but what other surprises lurk that I haven't discovered yet?


> You can just store the FFmpeg demuxer type in you DB, ignoring
> the mime-type.


Can I ask for clarification about one point?

I understand that ffprobe returns format (which includes format_name) and a
list of streams (which include codec_name).

When you say store the demuxer, are you referring to the format or codec?
And is it always a demuxer (rather than a muxer) because I'm probing the
file, rather than generating it?

> I would also appreciate any advice on assembling such a whitelist.
>
> Why would you disable any formats?


Because paranoia is a cheap substitute for perfect knowledge.

As I said, I was surprised when ffprobe inspected a text file without
complaint, and even reported a video stream.  (I expected an error.)
Clearly, a text file is not an acceptable source for a video hosting
platform that needs to generate preview clips and screenshots from the
original.

Since I can't know what other surprises are in store, it seemed wise to
start by drafting a list of commonly-encountered ffmpeg formats that are
*known* to be actual videos until I get a better grasp on the domain.

I generated the initial list by running a crawler against a collection of
videos I had lying around.  My intent was to log rejections, examine the
rejected file manually, and if it's actually a video, add the format to the
whitelist.

-ofer


More information about the ffmpeg-user mailing list