Interface FfmpegOptions

Options that influence the ffmpeg command used to create the slideshow.

Hierarchy

  • FfmpegOptions

Properties

ffmpegPath?: string

Path to ffmpeg binary.

Default Value

Automatically provided

ffprobePath?: string

Path to ffprobe binary.

Default Value

Automatically provided

showFfmpegOutput?: boolean

Whether to return the ffmpeg output of the slideshow creation.

Default Value

false

showFfmpegCommand?: boolean

Whether to return the ffmpeg command used to create the slideshow.

Default Value

false

container?: Container

Container format for the resulting slideshow.
Make sure to use a container that supports your codecs.

Default Value

mp4

fps?: number

Output framerate for the resulting slideshow.

Default Value

Let ffmpeg decide

pixelFormat?: string

Pixel format to use for the resulting slideshow.

Default Value

yuv420p

videoCodec?: string

Video codec to use for the resulting slideshow.
Make sure to use a codec that is supported by your container.

Default Value

libx264

audioCodec?: string

Audio codec to use for the resulting slideshow.
Make sure to use a codec that is supported by your container.

Default Value

Let ffmpeg decide

videoBitrate?: string

Video bitrate to use for the resulting slideshow.
Specify in ffmpeg format.

Example

'10M', '5000k'

Default Value

Let ffmpeg decide

audioBitrate?: string

Audio bitrate to use for the resulting slideshow.
Specify in ffmpeg format

Example

'128k', '320k'

Default Value

Let ffmpeg decide

x264Preset?: x264Preset

x264 preset to use for the resulting slideshow.\

Default Value

Let ffmpeg decide (should be medium)

streamCopyAudio?: boolean

Whether to avoid re-encoding the audio by stream copying it.
Make sure to use only when supported by your codec and container.
If you're unsure, I'd recommend you give it a try give it a try, you save on memory usage and encoding time if you can stream copy the audio.
Ffmpeg will fail if it's not supported.

Default Value

false

customOutputArgs?: string[]

Advanced:
Provide custom output arguments to ffmpeg which will override all default options, except video and audio stream mappings and total duration. Output filename will also be specified for you.
Specify in format suitable for the fluent-ffmpeg outputOptions api.

Think of the ffmpeg command as: ffmpeg <inputs> <complexFilter> -map [filterOutput] -map audio:a -t duration <customOutputArgs> outputFilename.format

So you will need to specify at the very least the video codec you want to use.
Also be sure to specify a compatible container via FFmpegOptions.container

Example

customOutputArgs: [
'-c:v libx264',
'-crf 20',
'-preset veryfast',
'-profile:v baseline',
'-level 3.0',
'-pix_fmt yuv420p'
'-movflags +faststart'
]

Default Value

none

Generated using TypeDoc