Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple FFmpeg versions #3464

Closed
wants to merge 1 commit into from
Closed

Conversation

mthrok
Copy link
Collaborator

@mthrok mthrok commented Jul 7, 2023

This commit introduces support for multiple FFmpeg versions for OSS binary distributions.

Currently torchaudio only works with FFmpeg 4. This is inconvenient from installing to runtime linking.
This commit allows to pick FFmpeg 4, 5 or 6 at runtime, instead of just looking for v4.

The way it works is that we compile the FFmpeg extension three times with different FFmpeg and ship them.
At runtime, we look for libavutil of specific version and when one is found, load the corresponding FFmpeg extension.
The order of preference is 6, 5, then 4.

To make the build process simple and reproducible, we use pre-built binaries of FFmpeg during the build.
They are LGPL and downloaded from S3 at build time, instead of building every time.

The use of pre-built binaries as scaffolding limits the system that can build torchaudio, so it also introduces
single FFmpeg version support mode. setting FFMPEG_ROOT during the build will change the way binaries are built
so that it will only support one specific version of FFmpeg.

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 7, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/3464

Note: Links to docs will display an error until the docs builds have been completed.

❌ 5 New Failures

As of commit dba6158:

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 7, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: b9562a0597f79d7feb6d3bf9172754610b01b39f
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47300223

mthrok added a commit to mthrok/audio that referenced this pull request Jul 7, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47300223

@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 10, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
mthrok added a commit to mthrok/audio that referenced this pull request Jul 10, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary: Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary:

This commit introduces support for multiple FFmpeg versions for OSS binary distributions.

Currently torchaudio only works with FFmpeg 4. This is inconvenient for users from installing to runtime linking.
This commit allows to pick FFmpeg 4, 5 or 6 at runtime, instead of just v4.

The way it works is that we compile the FFmpeg extension three times with different FFmpeg.
At runtime, we look for libavutil of specific version and when one is found, load the corresponding FFmpeg extension.
The look up order is is 6, 5, then 4.

To make the build process simple and reproducible, we use pre-built binaries of FFmpeg during the build.
They are LGPL and downloaded from S3 at build time, instead of building every time.

The use of pre-built binaries as scaffolding limits the system that can build torchaudio, so it also introduces
single FFmpeg version support mode. setting FFMPEG_ROOT during the build will change the way binaries are built
so that it will only support one specific version of FFmpeg.

Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary:

This commit introduces support for multiple FFmpeg versions for OSS binary distributions.

Currently torchaudio only works with FFmpeg 4. This is inconvenient for users from installing to runtime linking.
This commit allows to pick FFmpeg 4, 5 or 6 at runtime, instead of just v4.

The way it works is that we compile the FFmpeg extension three times with different FFmpeg.
At runtime, we look for libavutil of specific version and when one is found, load the corresponding FFmpeg extension.
The look up order is is 6, 5, then 4.

To make the build process simple and reproducible, we use pre-built binaries of FFmpeg during the build.
They are LGPL and downloaded from S3 at build time, instead of building every time.

The use of pre-built binaries as scaffolding limits the system that can build torchaudio, so it also introduces
single FFmpeg version support mode. setting FFMPEG_ROOT during the build will change the way binaries are built
so that it will only support one specific version of FFmpeg.

Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@mthrok mthrok marked this pull request as ready for review July 11, 2023 17:14
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

mthrok added a commit to mthrok/audio that referenced this pull request Jul 11, 2023
Summary:

This commit introduces support for multiple FFmpeg versions for OSS binary distributions.

Currently torchaudio only works with FFmpeg 4. This is inconvenient for users from installing to runtime linking.
This commit allows to pick FFmpeg 4, 5 or 6 at runtime, instead of just v4.

The way it works is that we compile the FFmpeg extension three times with different FFmpeg.
At runtime, we look for libavutil of specific version and when one is found, load the corresponding FFmpeg extension.
The look up order is is 6, 5, then 4.

To make the build process simple and reproducible, we use pre-built binaries of FFmpeg during the build.
They are LGPL and downloaded from S3 at build time, instead of building every time.

The use of pre-built binaries as scaffolding limits the system that can build torchaudio, so it also introduces
single FFmpeg version support mode. setting FFMPEG_ROOT during the build will change the way binaries are built
so that it will only support one specific version of FFmpeg.

Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Summary:

This commit introduces support for multiple FFmpeg versions for OSS binary distributions.

Currently torchaudio only works with FFmpeg 4. This is inconvenient for users from installing to runtime linking.
This commit allows to pick FFmpeg 4, 5 or 6 at runtime, instead of just v4.

The way it works is that we compile the FFmpeg extension three times with different FFmpeg.
At runtime, we look for libavutil of specific version and when one is found, load the corresponding FFmpeg extension.
The look up order is is 6, 5, then 4.

To make the build process simple and reproducible, we use pre-built binaries of FFmpeg during the build.
They are LGPL and downloaded from S3 at build time, instead of building every time.

The use of pre-built binaries as scaffolding limits the system that can build torchaudio, so it also introduces
single FFmpeg version support mode. setting FFMPEG_ROOT during the build will change the way binaries are built
so that it will only support one specific version of FFmpeg.

Pull Request resolved: pytorch#3464

Differential Revision: D47300223

Pulled By: mthrok

fbshipit-source-id: 0fef04461478402a457a537ce9bd6f68c54b02ab
@facebook-github-bot
Copy link
Contributor

@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mthrok merged this pull request in 786066b.

@github-actions
Copy link

Hey @mthrok.
You merged this PR, but labels were not properly added. Please add a primary and secondary label (See https://github.com/pytorch/audio/blob/main/.github/process_commit.py).


Some guidance:

Use 'module: ops' for operations under 'torchaudio/{transforms, functional}', and ML-related components under 'torchaudio/csrc' (e.g. RNN-T loss).

Things in "examples" directory:

  • 'recipe' is applicable to training recipes under the 'examples' folder,
  • 'tutorial' is applicable to tutorials under the “examples/tutorials” folder
  • 'example' is applicable to everything else (e.g. C++ examples)
  • 'module: docs' is applicable to code documentations (not to tutorials).

Regarding examples in code documentations, please also use 'module: docs'.

Please use 'other' tag only when you’re sure the changes are not much relevant to users, or when all other tags are not applicable. Try not to use it often, in order to minimize efforts required when we prepare release notes.


When preparing release notes, please make sure 'documentation' and 'tutorials' occur as the last sub-categories under each primary category like 'new feature', 'improvements' or 'prototype'.

Things related to build are by default excluded from the release note, except when it impacts users. For example:
* Drop support of Python 3.7.
* Add support of Python 3.X.
* Change the way a third party library is bound (so that user needs to install it separately).

@mthrok mthrok deleted the multi-ffmpeg branch July 12, 2023 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants