A Simple format describes the format specs you want to use in outputs section.
The format name follows this simple naming convention:
Only the container is required, which is really nice because the correct format specs are set for you like bitrates, codecs, sample rate, etc.
So let's say you want to use a fairly standard format like MP4 (H264 / AAC), the format name would be mp4. For a WebM format: webm and so on.
Here are some simple format examples to show you how it works:
mp4 mp4:240p_400k mp4:720p webm:600x0_800k mp4:hevc_720p_1500k webm:vp9 mp4::256k
If you want an audio only output format, use one of the audio container mp3, ogg, aac or wav. In that case, the $video_specs must be removed from the format name.
Example: mp3 ogg:64k mp3:64k_22050hz_mono
For each container, video and audio specs are set automatically for you following the video format standards. Most of the time, you just need to customize the output resolution and you get a format that just works.
Video specs must be separated by the underscore character _ and are all optional.
To disable video, set the video specs to x. For instance: mp4:x mp4:x:256k_48000hz.
Default resolution if not specified: 0x0 (=Original resolution)
There are two ways to specify the resolution: either with the classic widthxheight or with the *p notation like 720p or 1080p. Note that for thumbnails, GIF, only the notation widthxheight is working.
If you use the latter, the video bitrate is automatically set for you:
If you set the width or height to 0, we will automatically calculate the value for you according to the aspect ratio of the source video. 0x0 means that the original resolution will be kept.
Note that the video bitrate can still be overriden when using *p notation: mp4:720p_1800k.
• Video codec
Here is the list of video codecs we support:
mpeg4 xvid flv h263 mjpeg mpeg1video mpeg2video qtrle svq3 wmv1 wmv2 huffyuv rv20 h264 hevc vp8 vp9 theora dnxhd prores
Example: mp4:hevc_1080p_2000k avi:mpeg4_640x320
Note that we always set the right video codec associated to the right container for you. So unless you want HEVC or VP9, you can leave the video codec setting to us.
• Video bitrate
Default video bitrate if not specified: 1000k
The video bitrate must be given in kbps and always ends with k. Value must be < 200000k
Example: mp4:1080p_6000k webm:1200k
Default FPS if not specified: 0fps (=original FPS)
The FPS value must ends with fps, here are the possible FPS you can provide: 0fps 15fps 23.98fps 25fps 29.97fps 30fps
Note that 0fps means keep original FPS.
Example: mp4:240p_15fps mp4:720p_30fps
Audio specs must be separated by the underscore character _ and are all optional.
To disable audio, set the audio specs to x. Example: mp4:720p:x mp4:hevc_1080p:x
• Audio codec
Here is the list of audio codecs we support:
mp3 mp2 aac amr_nb ac3 vorbis flac pcm_u8 pcm_s16le pcm_alaw wmav2
Example: mkv:mpeg4:mp3 mpegts::mp3
Note that we always set the right audio codec associated to the right container for you. However you can customize it if you need to.
• Audio bitrate
Default audio bitrate if not specified: 128k
The audio bitrate must be given in kbps and always ends with k. Value must be <= 512k.
Example: mp4:1080p:512k webm:1200k:256k
• Sample rate
Default sample rate if not specified: 44100hz
The sample rate value must ends with hz, here are the possible sample rate you can provide:
8000hz 11025hz 16000hz 22000hz 22050hz 24000hz 32000hz 44000hz 44100hz 48000hz
Example: mp4:240p:64k_22050hz mp4:720p:48000hz
• Audio Channel
Default channel if not specified: stereo
Possible channel values are mono stereo
• pix_fmt: Set pixel format. Can be: yuv420p yuv422p
• 2pass: Enable 2pass encoding. For instance: mp4:720p::2pass
• vprofile: baseline main high high10 high422 high444
• level: 10 11 12 13 20 21 22 30 31 32 40 41 42 50 51
Generate a fragmented MP4 file if this option is used.
• vprofile: 0(Proxy) 1(LT) 2(SQ) 3(HQ)
Target a visual quality instead of a bitrate. From 1 (worst) to 5 (visually lossless) quality.
3 is pretty good quality with a good ratio quality / size.
Note that when using quality option, the video bitrate is ignored. Only works with H264, HEVC, VP8 and VP9.
If you want to constrain the maximum bitrate used, use the options maxrate=bitratek. For instance: mp4:1080p::quality=4,maxrate=4000k