FFmpegSource Documentation

Opens files using ffmpeg and nothing else. May be frame accurate on good days. The source is BSD licensed and can be obtained from https://spaceboyz.net/svn/aegisub/trunk/FFmpegSource. The precompiled binary is GPL licensed.

Compatibility - Video

Compatibility - Audio

Usage

FFmpegSource(string source, int vtrack = -1, int atrack = -2, string timecodes, bool vcache = true, string vcachefile, string acachefile, string pp, int ppquality = 6, int threads = -1, int seekmode = 1)

Note that the audio cache will always be created when opening files with audio and that it will be huge since it stores all audio as raw signed 16/24/32 bit pcm, unsigned 8 bit pcm or as float, using flac to compress it is also possible to reduce the size by half.

FFAudioSource(string source, int atrack = -1, string acachefile, string acachefile2)

Experimental, may or may not be accurate enough for real usage.

FFPP(clip, string pp, int ppquality = 6)
Separate postprocessing which also seems to include a few simple deinterlacers

SWScale(clip, width = -1, height = -1, resizer = "BICUBIC", colorspace = "")
Separate postprocessing which also seems to include a few simple deinterlacers

source: Source file.

atrack & vtrack: Track number as seen by the relevant demuxer, starts from 0, -1 means it will pick the first suitable track and -2 means it's disabled.

timecodes: File to output timecodes to, if the file exists it will be overwritten.

vcache: Write video indexing information to a file for later use. This setting does not control if The video index is loaded which it always is if it exists.

vcachefile, acachefile & acachefile2: Specifies the file to store the index information or raw audio in, if nothing is specified (source).ffv(tracknumber)cache is used for video and (source).ffa(d if FFAudioSource is used)(tracknumber)cache for audio. The second audio cache file is only required/created when not opening matroska files.

pp: See the table below for a full description, an empty string means no processing. It is recommended to avoid the autoq option since it's currently unknown what effect it will have on the processing.

ppquality: The quality to use for the specified postprocessing. Valid values are 0-6 where 0 usually means that no actual processing is done.

threads: Sets the number of decoder threads used. Defaults to the number of cpus reported by windows. Ignored by lavc if the used decoder doesn't implement it.

seekmode: Force how seeking is handled, has no effect on matroska files which always use the equivalent of seekmode=1
-1: linear access without rewind, will throw an error if each successive requested frame number isn't bigger than the last one, only intended for opening images but might work on well with some obscure video format
0: linear access, the definition of slow but should make some formats "usable"
1: safe normal, bases seeking decisions on the reported keyframe positions
2: unsafe normal, same as 1 but no error will be thrown if the exact destination has to be guessed
3: aggressive, seek in the forward direction even if no closer keyframe is known to exist, only useful for testing and containers where avformat doesn't report keyframes properly

width & height: Width and height to resize to. Value below or equal to 0 is the same as specifying the input dimensions.

resizer: Selects the resizer used for resampling the chroma planes and normal resizing. The available methods are: FAST_BILINEAR, BILINEAR, BICUBIC, X, POINT, AREA, BICUBLIN, GAUSS, SINC, LANCZOS and SPLINE.

colorspace: The colorspace to convert to. The names are YV12, YUY2, RGB24, RGB32 and the empty string for same as input.

PP string format

Available postprocessing filters:
Filters                        Options
short  long name       short   long option     Description
*      *               a       autoq           CPU power dependent enabler
                       c       chrom           chrominance filtering enabled
                       y       nochrom         chrominance filtering disabled
                       n       noluma          luma filtering disabled
hb     hdeblock        (2 threshold)           horizontal deblocking filter
       1. difference factor: default=32, higher -> more deblocking
       2. flatness threshold: default=39, lower -> more deblocking
                       the h & v deblocking filters share these
                       so you can't set different thresholds for h / v
vb     vdeblock        (2 threshold)           vertical deblocking filter
ha     hadeblock       (2 threshold)           horizontal deblocking filter
va     vadeblock       (2 threshold)           vertical deblocking filter
h1     x1hdeblock                              experimental h deblock filter 1
v1     x1vdeblock                              experimental v deblock filter 1
dr     dering                                  deringing filter
al     autolevels                              automatic brightness / contrast
                       f        fullyrange     stretch luminance to (0..255)
lb     linblenddeint                           linear blend deinterlacer
li     linipoldeint                            linear interpolating deinterlace
ci     cubicipoldeint                          cubic interpolating deinterlacer
md     mediandeint                             median deinterlacer
fd     ffmpegdeint                             ffmpeg deinterlacer
l5     lowpass5                                FIR lowpass deinterlacer
de     default                                 hb:a,vb:a,dr:a
fa     fast                                    h1:a,v1:a,dr:a
ac                                             ha:a:128:7,va:a,dr:a
tn     tmpnoise        (3 threshold)           temporal noise reducer
                     1. <= 2. <= 3.            larger -> stronger filtering
fq     forceQuant                   force quantizer
Usage:
[:

Compiling

zlib from http://www.zlib.net/

FFmpeg svn from http://ffmpeg.mplayerhq.hu/

Required FFmpeg Configuration: ./configure --enable-memalign-hack --enable-gpl --enable-swscale --enable-postproc

Suggested Additional Options: --enable-w32threads --disable-encoders --disable-muxers --enable-small --enable-libfaad --disable-debug

Note that --enable-w32threads is required for multithreaded decoding to work.

Changes