How to Submit a Patch to the FFmpeg Mailing List

Submitting a patch to the FFmpeg project involves cloning the official repository, writing code that adheres to project guidelines, and sending a properly formatted patch using Git's email tools. This guide covers the required steps from configuring your local environment to generating and sending your patch to the ffmpeg-devel mailing list.

1. Subscribe to the Mailing List

Before sending patches, subscribe to the FFmpeg development mailing list (ffmpeg-devel@ffmpeg.org). While non-subscribers can send emails, their messages are held for moderation, which causes delays. Subscribing also allows you to receive review comments directly and reply to discussion threads.

2. Clone the Repository and Configure Git

Obtain the latest source code from the official FFmpeg Git repository:

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg

Ensure your Git identity is configured with your real name and email address:

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

3. Implement and Test Changes

Make your changes on a dedicated branch. Ensure your code follows the FFmpeg coding style:

  • Use 4-space indentation (no tabs).
  • Follow the C99 standard.
  • Prefix functions and variables consistently with the module they belong to.

Run regression tests before committing to verify your changes do not break existing functionality:

make
make fate

4. Create a Clean Commit

Commit your changes with a clear, standard commit message. The first line must be a concise summary prefixed with the affected component (e.g., avcodec/aac: fix decoding artifact), followed by a blank line and a detailed description of the changes:

git commit -s -a

Using -s adds a Signed-off-by line, which certifies that you have the right to submit the code under the project's license.

5. Generate the Patch

Generate a patch file from your latest commit using git format-patch:

git format-patch -1

This command creates a .patch file named after your commit message. If submitting a revised patch series in response to feedback, use the -v flag to increment the version number:

git format-patch -v2 -1

6. Send the Patch Using git send-email

The FFmpeg project requires patches to be sent via email in plain-text format. Standard webmail clients often alter spacing or wrap lines, breaking the patch. Configure and use git send-email to transmit the patch file:

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

7. Review and Follow-up

Once sent, your patch will appear in the mailing list archive and on the project's Patchwork tracker. Reviewers may request modifications. When responding to review comments:

  • Use inline, plain-text email replies (bottom-posting).
  • Do not top-post.
  • If updates are requested, make the changes, squash your revisions into the original commit (or provide a clean series), and resubmit with an incremented version flag (e.g., [PATCH v2]). Include a changelog below the triple-dash (---) separator in the patch so reviewers can track changes between revisions.