[FFmpeg-user] format_whitelist and fFMPEG command

Moritz Barsnick barsnick at gmx.net
Wed Jul 22 11:03:37 CEST 2015


On Wed, Jul 22, 2015 at 05:02:27 +0000, Dani A wrote:

> Can someone show me how can I use the format_whitelist in a command
> for FFMPEG? Or at least send me a link showing how to use it?

Indeed, there are no examples. But it seems to be quite
straightforward. "-format_whitelist" takes a comma separated list of
allowed formats.

$ ffmpeg -format_whitelist "mp4" -i testfile.mkv -f null -
ffmpeg version N-73534-g3bb58c3 Copyright (c) 2000-2015 the FFmpeg developers
  built with icc (ICC) 14.0.3 20140422
  configuration: --prefix=/usr/new/tools/video/install/ffmpeg/2015-07-11 --cc=icc --cxx=icpc --enable-gpl --enable-version3 --enable-nonfree --disable-shared --enable-gnutls --enable-libcdio --enable-libfreetype --enable-libx264 --enable-libmp3lame --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libass --enable-libv4l2 --enable-libvidstab --enable-libfdk-aac --enable-libsmbclient --enable-libquvi --enable-libzvbi --enable-libzmq
  libavutil      54. 28.100 / 54. 28.100
  libavcodec     56. 47.100 / 56. 47.100
  libavformat    56. 40.100 / 56. 40.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 21.100 /  5. 21.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
[matroska,webm @ 0x9d26ce0] Format not on whitelist
testfile.mkv: Invalid argument

If you replace "mp4" with "webm" or "mp4,webm", the command succeeds.
(I won't quote it here.)

Some formats seem to have various possible names, which you can see
with "ffprobe -show_format". My MKV shows as "matroska,webm", handing
either of those to "-format_whitelist" works for me. Same for an MP4
which shows as "mov,mp4,m4a,3gp,3g2,mj2".

Although the "Format Options" section of the documentation says:
> global options, which can be set on all the muxers and demuxers
the documentation for this option properly points out that it only
applies to demuxers, i.e. as an input option. As an output option, it
seems to have no effect.

Moritz


More information about the ffmpeg-user mailing list