How to Submit a Patch to the FFmpeg Mailing List

Contributing to FFmpeg requires submitting code changes as patches to the official development mailing list. This guide provides a direct, step-by-step walkthrough on how to prepare your Git environment, format your code changes, and successfully email your patch to the FFmpeg community for review.

1. Configure Git

Before creating a patch, ensure your Git configuration has your correct real name and email address. The FFmpeg project does not accept anonymous contributions or pseudonyms. Run the following commands in your terminal:

git config --global user.name "Your Real Name"
git config --global user.email "your.email@example.com"

2. Make Your Changes and Commit

Create a new branch for your changes, apply your code modifications, and commit them locally. Your commit message must be clear and adhere to the FFmpeg style: * Use a short prefix indicating the component you modified (e.g., avcodec/utils: or doc:). * Write a concise summary in the imperative mood (e.g., “fix memory leak”). * Provide a detailed explanation in the body of the commit message if necessary.

git checkout -b my-contribution-branch
# (Make your code edits here)
git add modified_file.c
git commit -m "avcodec/example: fix null pointer dereference in decoder"

3. Generate the Patch File

FFmpeg requires patches to be generated using git format-patch. This utility converts your local commits into properly formatted email drafts. To generate a patch for your most recent commit, run:

git format-patch -1

This command generates a .patch file in your current directory.

4. Set Up Git Send-Email

The most reliable way to submit a patch without formatting corruption (such as line-wrapping or tab-to-space conversion by email clients) is using git send-email.

You may need to install it first via your system package manager (e.g., sudo apt-get install git-email on Debian/Ubuntu).

Configure your SMTP settings in Git to allow sending emails through your email provider:

git config --global sendemail.smtpserver smtp.example.com
git config --global sendemail.smtpserverport 587
git config --global sendemail.smtpencryption tls
git config --global sendemail.smtpuser your.email@example.com

5. Send the Patch to the Mailing List

Submit your generated patch to the official FFmpeg development mailing list: ffmpeg-devel@ffmpeg.org.

Run the following command to send the patch:

git send-email --to=ffmpeg-devel@ffmpeg.org 0001-your-patch-file.patch

You will be prompted to enter your email password to complete the transmission. Once sent, your patch will appear on the mailing list, where developers will review it and provide feedback.