Skip to main content
Post-processors allow you to manipulate downloaded files after they’ve been saved. Common uses include converting formats, extracting audio, embedding metadata, and more.

What is a Post-Processor?

A post-processor is a component that:
  • Runs after a video has been downloaded
  • Modifies, converts, or enhances the downloaded file
  • Can be chained with other post-processors
  • Returns information about processed files
All post-processors inherit from the PostProcessor base class.

Using Post-Processors

Via Options Dictionary

The most common way to use post-processors is through the postprocessors option:

Via add_post_processor()

You can also add post-processors programmatically:

PostProcessor Base Class

All post-processors inherit from this base class.

Constructor

YoutubeDL
The YoutubeDL instance that will use this post-processor

Main Method: run()

Every post-processor must implement the run() method:
dict
required
Dictionary containing video information and the ‘filepath’ key pointing to the downloaded file
tuple[list, dict]
Returns a tuple of (files_to_delete, updated_information)

Utility Methods

method
Print a message to the screen
method
Report a warning message
method
Write a debug message
method
Get a parameter from the YoutubeDL instance

When to Run Post-Processors

Post-processors can run at different stages of the download process:
string
Before any processing (very early)
string
After video is filtered but before download
string
Just before downloading
string
default:"true"
After download completes (default)
string
After file is moved to final location
string
After all post-processors for a video
string
After entire playlist is processed

Common Post-Processors

FFmpegExtractAudio

Extract audio from video files.

FFmpegVideoConvertor

Convert video to a different format.

FFmpegVideoRemuxer

Remux video to a different container without re-encoding.

FFmpegMetadata

Embed metadata and chapters into the video file.

EmbedThumbnail

Embed thumbnail into the media file.

FFmpegEmbedSubtitle

Embed subtitles into the video file.

FFmpegSubtitlesConvertor

Convert subtitles to a different format.

FFmpegThumbnailsConvertor

Convert thumbnails to a different format.

MetadataParser

Parse and modify metadata fields.

Exec

Execute external commands on downloaded files.

SponsorBlock

Remove or mark sponsored segments (YouTube only).

ModifyChapters

Modify or remove chapter markers.

XAttrMetadata

Write metadata to extended file attributes.

MoveFilesAfterDownload

Move files to a different location after download.

Chaining Post-Processors

You can chain multiple post-processors together:

Custom Post-Processor Example

Create a custom post-processor:

Progress Hooks for Post-Processors

Monitor post-processor progress:

FFmpeg Location

Many post-processors require FFmpeg. Specify its location:

Post-Processor Arguments

Pass additional arguments to post-processors: