Difference between revisions of "Documentation:Modules/avcodec"

From VideoLAN Wiki
Jump to navigation Jump to search
m (Replace IDCT with wikipedia:IDCT#DCT-III)
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
Options prefixed with ''ffmpeg-'' or ''sout-ffmpeg-'' were deprecated in 2.1.0 to reflect the new module name ''avcodec''. The only option that seems not to have been replaced later is <code>--avcodec-vismv</code>, removed in 3.0.0.
 
Options prefixed with ''ffmpeg-'' or ''sout-ffmpeg-'' were deprecated in 2.1.0 to reflect the new module name ''avcodec''. The only option that seems not to have been replaced later is <code>--avcodec-vismv</code>, removed in 3.0.0.
 +
 +
The variable <var>ENC_PROFILE_LONGTEXT</var> [https://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/avcodec/avcodec.h;h=5e526a3b1cd61d9eb90d79223994c115c1ac35e1;hb=HEAD#l230 defined in modules/codec/avcodec/avcodec.h] does not mention [https://git.videolan.org/?p=vlc.git;a=blob;f=modules/codec/avcodec/encoder.c;h=2f8e2d8a145c2558f57c97787eba2af407ec6af3;hb=HEAD#l477 that it checks] for <code>ld</code> (Low Delay) and <code>eld</code> (Extended Low Delay). FIXME: Unclear whether they are actually supported.
  
 
Options as of 3.0.6:
 
Options as of 3.0.6:
  
 
== Decoding ==
 
== Decoding ==
{{Option|name=avcodec-dr|value=boolean|description=Direct rendering|default=enabled}}
+
{{Option|name=avcodec-dr|value=boolean|default=enabled|description=Direct rendering}}
{{Option|name=avcodec-corrupted|value=boolean|description=Show corrupted frames|default=enabled}}
+
{{Option|name=avcodec-corrupted|value=boolean|default=enabled|description=Prefer visual artifacts instead of missing frames}}
{{Option|name=avcodec-error-resilience|value=integer|description=Error resilience}}
+
{{Option|name=avcodec-error-resilience|value=integer|min=0|max=4|default=1|description=libavcodec can do error resilience. However, with a buggy encoder (such as the ISO MPEG-4 encoder from M$) this can produce a lot of errors. Valid values range from 0 to 4 (0 disables all errors resilience)}}
{{Option|name=avcodec-workaround-bugs|value=integer|description=Workaround bugs}}
+
{{Option|name=avcodec-workaround-bugs|value=integer|default=1|description=Try to fix some bugs: 1  autodetect, 2  old msmpeg4, 4  xvid interlaced, 8  ump4, 16 no padding, 32 ac vlc, 64 Qpel chroma. This must be the sum of the values. For example, to fix "ac vlc" and "ump4", enter 40.)}}
{{Option|name=avcodec-hurry-up|value=boolean|description=Hurry up|default=enabled}}
+
{{Option|name=avcodec-hurry-up|value=boolean|default=enabled|description=The decoder can partially decode or skip frame(s) when there is not enough time. It's useful with low CPU power but it can produce distorted pictures}}
{{Option|name=avcodec-skip-frame|value=integer|select={-1 (None), 0 (Default), 1 (Non-ref), 2 (Bidir), 3 (Non-key), 4 (All)}|description=Skip frame|default=0}}
+
{{Option|name=avcodec-skip-frame|value=integer|select={-1,0,1,2,3,4}|default=0|description=Force skipping of [[frame]]s to speed up decoding (-1=None, 0=Default, 1=[[B-frame]]s, 2=[[P-frame]]s, 3=B+P frames, 4=all frames)}}
{{Option|name=avcodec-skip-idct|value=integer|select={-1 (None), 0 (Default), 1 (Non-ref), 2 (Bidir), 3 (Non-key), 4 (All)}|description=Skip [[IDCT]]|default=0}}
+
{{Option|name=avcodec-skip-idct|value=integer|select={-1,0,1,2,3,4}|default=0|description=Force skipping of [[wikipedia:IDCT#DCT-III|IDCT]] to speed up decoding for frame types (-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames)}}
{{Option|name=avcodec-fast|value=boolean|description=Allow speed tricks|default=disabled}}
+
{{Option|name=avcodec-fast|value=boolean|default=disabled|description=Allow non specification compliant speedup tricks. Faster but error-prone}}
{{Option|name=avcodec-skiploopfilter|value=integer|select={0 (None), 1 (Non-ref), 2 (Bidir), 3 (Non-key), 4 (All)}|description=Skip the loop filter for H.264 decoding)}}
+
{{Option|name=avcodec-skiploopfilter|value=integer|select={0 (None), 1 (Non-ref), 2 (Bidir), 3 (Non-key), 4 (All)}|default=0|description=Skipping the loop filter (aka deblocking) usually has a detrimental effect on quality. However it provides a big speedup for high definition streams}}
{{Option|name=avcodec-debug|value=integer|description=Debug mask}}
+
{{Option|name=avcodec-debug|value=integer|default=0|description=Set FFmpeg debug mask}}
{{Option|name=avcodec-codec|value=string|description=Codec name}}
+
{{Option|name=avcodec-codec|value=string|default=NULL|description=Internal libavcodec codec name}}
{{Option|name=avcodec-hw|value=integer|select={any,vdpau_avcodec,vaapi,vaapi_drm,none}|description=Hardware decoding}}
+
{{Option|name=avcodec-hw|value=integer|select={any,vdpau_avcodec,vaapi,vaapi_drm,none}|default=any|description=This allows hardware decoding when available}}
{{Option|name=avcodec-threads|value=integer|description=Threads}}
+
{{Option|name=avcodec-threads|value=integer|default=0|description=Number of threads used for decoding, 0 meaning auto}}
{{Option|name=avcodec-options|value=string|description=Advanced options}}
+
{{Option|name=avcodec-options|value=string|default=NULL|description=Advanced options, in the form <code>{opt=val,opt2=val2}</code>}}
  
 
== Encoding ==
 
== Encoding ==
{{Option|name=sout-avcodec-codec|value=string|description=Codec name}}
+
{{Option|name=sout-avcodec-codec|value=string|default=NULL|description=Internal libavcodec [[codec]] name}}
{{Option|name=sout-avcodec-hq|value=string|select={rd,bits,simple}|description=Quality level}}
+
{{Option|name=sout-avcodec-hq|value=string|select={rd,bits,simple}|default=rd|description=Quality level for the encoding of motions vectors (this can slow down the encoding very much)}}
{{Option|name=sout-avcodec-keyint|value=integer|description=Ratio of key frames}}
+
{{Option|name=sout-avcodec-keyint|value=integer|default=0|description=Number of frames that will be coded for one [[key frame]]}}
{{Option|name=sout-avcodec-bframes|value=integer|description=Ratio of B frames}}
+
{{Option|name=sout-avcodec-bframes|value=integer|default=0|description=Number of [[B-frame]]s that will be coded between two reference frames}}
{{Option|name=sout-avcodec-hurry-up|value=boolean|description=Hurry up|default=disabled}}
+
{{Option|name=sout-avcodec-hurry-up|value=boolean|default=disabled|description=The encoder can make on-the-fly quality tradeoffs if your CPU can't keep up with the encoding rate. It will disable trellis quantization, then the rate distortion of motion vectors (hq), and raise the noise reduction threshold to ease the encoder's task}}
{{Option|name=sout-avcodec-interlace|value=boolean|description=Interlaced encoding|default=disabled}}
+
{{Option|name=sout-avcodec-interlace|value=boolean|default=disabled|description=Enable dedicated
{{Option|name=sout-avcodec-interlace-me|value=boolean|description=Interlaced motion estimation|default=enabled}}
+
algorithms for [[interlaced]] frames}}
{{Option|name=sout-avcodec-vt|value=integer|description=Video bitrate tolerance}}
+
{{Option|name=sout-avcodec-interlace-me|value=boolean|default=enabled|description=Enable interlaced motion estimation algorithms. This requires more CPU}}
{{Option|name=sout-avcodec-pre-me|value=boolean|description=Pre-motion estimation|default=disabled}}
+
{{Option|name=sout-avcodec-vt|value=integer|default=0|description=Video [[bitrate]] tolerance in kbit/s}}
{{Option|name=sout-avcodec-rc-buffer-size|value=integer|description=Rate control buffer size}}
+
{{Option|name=sout-avcodec-pre-me|value=boolean|default=disabled|description=Enable the pre-motion estimation algorithm}}
{{Option|name=sout-avcodec-rc-buffer-aggressivity|value=float|description=Rate control buffer aggressiveness}}
+
{{Option|name=sout-avcodec-rc-buffer-size|value=integer|default=0|description=Rate control buffer size (in kbytes). A bigger buffer will allow for better rate control, but will cause a delay in the stream}}
{{Option|name=sout-avcodec-i-quant-factor|value=float|description=I quantization factor}}
+
{{Option|name=sout-avcodec-rc-buffer-aggressivity|value=float|default=1.0|description=Rate control buffer aggressiveness}}
{{Option|name=sout-avcodec-noise-reduction|value=integer|description=Noise reduction}}
+
{{Option|name=sout-avcodec-i-quant-factor|value=float|default=0|description=Quantization factor of [[I-frame]]s, compared with [[P-frame]]s (for instance 1.0 => same qscale for I and P frames)}}
{{Option|name=sout-avcodec-mpeg4-matrix|value=boolean|description=MPEG4 quantization matrix|default=disabled}}
+
{{Option|name=sout-avcodec-noise-reduction|value=integer|default=0|description=Enable a simple noise reduction algorithm to lower the encoding length and bitrate, at the expense of lower quality frames}}
{{Option|name=sout-avcodec-qmin|value=integer|description=Minimum video quantizer scale}}
+
{{Option|name=sout-avcodec-mpeg4-matrix|value=boolean|default=disabled|description=Use the [[MPEG-4]] quantization matrix for [[MPEG-2]] encoding. This generally yields a better looking picture, while still retaining the compatibility with standard MPEG-2 decoders}}
{{Option|name=sout-avcodec-qmax|value=integer|description=Maximum video quantizer scale}}
+
{{Option|name=sout-avcodec-qmin|value=integer|default=0|description=Minimum video quantizer scale}}
{{Option|name=sout-avcodec-trellis|value=boolean|description=Trellis quantization|default=disabled}}
+
{{Option|name=sout-avcodec-qmax|value=integer|default=0|description=Maximum video quantizer scale}}
{{Option|name=sout-avcodec-qscale|value=float|description=Fixed quantizer scale}}
+
{{Option|name=sout-avcodec-trellis|value=boolean|default=disabled|description=Enable trellis quantization (rate distortion for block coefficients)}}
{{Option|name=sout-avcodec-strict|value=integer|min=-2|max=2|description=Strict standard compliance}}
+
{{Option|name=sout-avcodec-qscale|value=float|min=0.01|max=255.0|default=3|description=A fixed video quantizer scale for [[VBR]] encoding (accepted values: 0.01 to 255.0)}}
{{Option|name=sout-avcodec-lumi-masking|value=float|description=Luminance masking}}
+
{{Option|name=sout-avcodec-strict|value=integer|min=-2|max=2|default=0|description=Force a strict standard compliance when encoding (accepted values: -2 to 2)}}
{{Option|name=sout-avcodec-dark-masking|value=float|description=Darkness masking}}
+
{{Option|name=sout-avcodec-lumi-masking|value=float|default=0.0|description=Raise the quantizer for very bright macroblocks}}
{{Option|name=sout-avcodec-p-masking|value=float|description=Motion masking}}
+
{{Option|name=sout-avcodec-dark-masking|value=float|default=0.0|description=Raise the quantizer for very dark macroblocks}}
{{Option|name=sout-avcodec-border-masking|value=float|description=Border masking}}
+
{{Option|name=sout-avcodec-p-masking|value=float|default=0.0|description=Raise the quantizer for macroblocks with a high temporal complexity}}
{{Option|name=sout-avcodec-luma-elim-threshold|value=integer|description=Luminance elimination}}
+
{{Option|name=sout-avcodec-border-masking|value=float|default=0.0|description=Raise the quantizer for macroblocks at the border of the frame}}
{{Option|name=sout-avcodec-chroma-elim-threshold|value=integer|description=Chrominance elimination}}
+
{{Option|name=sout-avcodec-luma-elim-threshold|value=integer|default=0|description=Eliminates luminance blocks when the PSNR isn't much changed. The [[H.264]] specification recommends -4}}
{{Option|name=sout-avcodec-aac-profile|value=string|description=Specify AAC audio profile to use}}
+
{{Option|name=sout-avcodec-chroma-elim-threshold|value=integer|default=0|description=Eliminates chrominance blocks when the PSNR isn't much changed. The [[H.264]] specification recommends 7}}
{{Option|name=sout-avcodec-options|value=string|description=Advanced options}}
+
{{Option|name=sout-avcodec-aac-profile|value=string|default=low|description=Specify the [[AAC]] audio profile to use for encoding the audio bitstream. It takes the following options: main, low, ssr (not supported), ltp, hev1, hev2. hev1 and hev2 are currently supported only with libfdk-aac enabled libavcodec}}
 +
{{Option|name=sout-avcodec-options|value=string|default=NULL|description=Advanced options, in the form <code>{opt=val,opt2=val2}</code>}}
  
 
== Source code ==
 
== Source code ==

Latest revision as of 06:10, 16 May 2019

Module: avcodec
Type codec library
First VLC version -
Last VLC version -
Operating system(s) all
Description Various audio and video decoders/encoders delivered by the FFmpeg library. This includes (MS)MPEG4, DivX, SVQ1, H261, H263, H264, WMV, WMA, AAC, AMR, DV, MJPEG and other codecs
Shortcut(s) -

libavcodec provided by the FFmpeg project. A full list of supported codecs may be found with modules/codec/avcodec/fourcc.c

Options prefixed with ffmpeg- or sout-ffmpeg- were deprecated in 2.1.0 to reflect the new module name avcodec. The only option that seems not to have been replaced later is --avcodec-vismv, removed in 3.0.0.

The variable ENC_PROFILE_LONGTEXT defined in modules/codec/avcodec/avcodec.h does not mention that it checks for ld (Low Delay) and eld (Extended Low Delay). FIXME: Unclear whether they are actually supported.

Options as of 3.0.6:

Decoding

  • avcodec-dr <boolean> : Direct rendering default value: enabled
  • avcodec-corrupted <boolean> : Prefer visual artifacts instead of missing frames default value: enabled
  • avcodec-error-resilience <integer [0 .. 4]> : libavcodec can do error resilience. However, with a buggy encoder (such as the ISO MPEG-4 encoder from M$) this can produce a lot of errors. Valid values range from 0 to 4 (0 disables all errors resilience) default value: 1
  • avcodec-workaround-bugs <integer> : Try to fix some bugs: 1 autodetect, 2 old msmpeg4, 4 xvid interlaced, 8 ump4, 16 no padding, 32 ac vlc, 64 Qpel chroma. This must be the sum of the values. For example, to fix "ac vlc" and "ump4", enter 40.) default value: 1
  • avcodec-hurry-up <boolean> : The decoder can partially decode or skip frame(s) when there is not enough time. It's useful with low CPU power but it can produce distorted pictures default value: enabled
  • avcodec-skip-frame <integer> {-1,0,1,2,3,4} : Force skipping of frames to speed up decoding (-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames) default value: 0
  • avcodec-skip-idct <integer> {-1,0,1,2,3,4} : Force skipping of IDCT to speed up decoding for frame types (-1=None, 0=Default, 1=B-frames, 2=P-frames, 3=B+P frames, 4=all frames) default value: 0
  • avcodec-fast <boolean> : Allow non specification compliant speedup tricks. Faster but error-prone default value: disabled
  • avcodec-skiploopfilter <integer> {0 (None), 1 (Non-ref), 2 (Bidir), 3 (Non-key), 4 (All)} : Skipping the loop filter (aka deblocking) usually has a detrimental effect on quality. However it provides a big speedup for high definition streams default value: 0
  • avcodec-debug <integer> : Set FFmpeg debug mask default value: 0
  • avcodec-codec <string> : Internal libavcodec codec name default value: NULL
  • avcodec-hw <integer> {any,vdpau_avcodec,vaapi,vaapi_drm,none} : This allows hardware decoding when available default value: any
  • avcodec-threads <integer> : Number of threads used for decoding, 0 meaning auto default value: 0
  • avcodec-options <string> : Advanced options, in the form {opt=val,opt2=val2} default value: NULL

Encoding

  • sout-avcodec-codec <string> : Internal libavcodec codec name default value: NULL
  • sout-avcodec-hq <string> {rd,bits,simple} : Quality level for the encoding of motions vectors (this can slow down the encoding very much) default value: rd
  • sout-avcodec-keyint <integer> : Number of frames that will be coded for one key frame default value: 0
  • sout-avcodec-bframes <integer> : Number of B-frames that will be coded between two reference frames default value: 0
  • sout-avcodec-hurry-up <boolean> : The encoder can make on-the-fly quality tradeoffs if your CPU can't keep up with the encoding rate. It will disable trellis quantization, then the rate distortion of motion vectors (hq), and raise the noise reduction threshold to ease the encoder's task default value: disabled
  • sout-avcodec-interlace <boolean> : Enable dedicated

algorithms for interlaced frames default value: disabled

  • sout-avcodec-interlace-me <boolean> : Enable interlaced motion estimation algorithms. This requires more CPU default value: enabled
  • sout-avcodec-vt <integer> : Video bitrate tolerance in kbit/s default value: 0
  • sout-avcodec-pre-me <boolean> : Enable the pre-motion estimation algorithm default value: disabled
  • sout-avcodec-rc-buffer-size <integer> : Rate control buffer size (in kbytes). A bigger buffer will allow for better rate control, but will cause a delay in the stream default value: 0
  • sout-avcodec-rc-buffer-aggressivity <float> : Rate control buffer aggressiveness default value: 1.0
  • sout-avcodec-i-quant-factor <float> : Quantization factor of I-frames, compared with P-frames (for instance 1.0 => same qscale for I and P frames) default value: 0
  • sout-avcodec-noise-reduction <integer> : Enable a simple noise reduction algorithm to lower the encoding length and bitrate, at the expense of lower quality frames default value: 0
  • sout-avcodec-mpeg4-matrix <boolean> : Use the MPEG-4 quantization matrix for MPEG-2 encoding. This generally yields a better looking picture, while still retaining the compatibility with standard MPEG-2 decoders default value: disabled
  • sout-avcodec-qmin <integer> : Minimum video quantizer scale default value: 0
  • sout-avcodec-qmax <integer> : Maximum video quantizer scale default value: 0
  • sout-avcodec-trellis <boolean> : Enable trellis quantization (rate distortion for block coefficients) default value: disabled
  • sout-avcodec-qscale <float [0.01 .. 255.0]> : A fixed video quantizer scale for VBR encoding (accepted values: 0.01 to 255.0) default value: 3
  • sout-avcodec-strict <integer [-2 .. 2]> : Force a strict standard compliance when encoding (accepted values: -2 to 2) default value: 0
  • sout-avcodec-lumi-masking <float> : Raise the quantizer for very bright macroblocks default value: 0.0
  • sout-avcodec-dark-masking <float> : Raise the quantizer for very dark macroblocks default value: 0.0
  • sout-avcodec-p-masking <float> : Raise the quantizer for macroblocks with a high temporal complexity default value: 0.0
  • sout-avcodec-border-masking <float> : Raise the quantizer for macroblocks at the border of the frame default value: 0.0
  • sout-avcodec-luma-elim-threshold <integer> : Eliminates luminance blocks when the PSNR isn't much changed. The H.264 specification recommends -4 default value: 0
  • sout-avcodec-chroma-elim-threshold <integer> : Eliminates chrominance blocks when the PSNR isn't much changed. The H.264 specification recommends 7 default value: 0
  • sout-avcodec-aac-profile <string> : Specify the AAC audio profile to use for encoding the audio bitstream. It takes the following options: main, low, ssr (not supported), ltp, hev1, hev2. hev1 and hev2 are currently supported only with libfdk-aac enabled libavcodec default value: low
  • sout-avcodec-options <string> : Advanced options, in the form {opt=val,opt2=val2} default value: NULL

Source code

This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.