-
Notifications
You must be signed in to change notification settings - Fork 657
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
Use FFmpeg-based I/O as fallback in sox_io backend #2419
Conversation
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cd012b3
to
e978398
Compare
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
This pull request was exported from Phabricator. Differential Revision: D36740306 |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: b933f5a55ec5f5bb8d6ec4abbf1ad796839258d0
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
This pull request was exported from Phabricator. Differential Revision: D36740306 |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. Depends on pytorch#2416, pytorch#2417, pytorch#2418 Pull Request resolved: pytorch#2419 Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 91dfdd199959d83ce643ccc38cf163ce29fba55e
@mthrok has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This commit add fallback mechanism to `info` and `load` functions of sox_io backend. If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded, in case `info` and `load` fail, it fallback to FFmpeg-based implementation. BC-breaking changes: - FFmpeg does not report the number of frames for MP3, this is because MP3 does not store the information of the number of frames. It can be estimated from the audio duration and sample rate, but it might be inaccurate, so we keep it 0. Depends on - pytorch#2416 - pytorch#2417 - pytorch#2418 - pytorch#2423 - pytorch#2427 Pull Request resolved: pytorch#2419 Reviewed By: carolineechen Differential Revision: D36740306 Pulled By: mthrok fbshipit-source-id: 071d9441019b7e76bd9a7f44ed236333ca406be9
This pull request was exported from Phabricator. Differential Revision: D36740306 |
Hey @mthrok. |
Summary: Remove the code related to libmad, which had been disabled in #2354 In #2419, we mp3 decoding to ffmpeg. But CI tests were still using libmad. This commit completely removes libmad from torchaudio. This is BC-breaking change as `apply_sox_effects_file` function cannot handle MP3, and it cannot fallback to ffmpeg. The workaround for this is to use `torchaudio.load` then `apply_sox_effects_tensor`. Pull Request resolved: #2428 Reviewed By: carolineechen Differential Revision: D36851805 Pulled By: mthrok fbshipit-source-id: f98795c59a1ac61cef511f2bbeac37f7c3c69d55
Loading and querying file-like object is not possible to use the fallback mechanism introduced in pytorch#2419 because file-like objects are not seekable. This commit add special case handling to mp3. For filelike object mp3 input, it was required to pass `format="mp3"` because libsox did not auto detect the format. With the transition of mp3 handling from libsox to ffmpeg, the logic is to let the ffmpeg handle it without waiting for libsox to fail, if the `format="mp3"`
Loading and querying file-like object is not possible to use the fallback mechanism introduced in pytorch#2419 because file-like objects are not seekable. This commit add special case handling to mp3. For filelike object mp3 input, it was required to pass `format="mp3"` because libsox did not auto detect the format. With the transition of mp3 handling from libsox to ffmpeg, the logic is to let the ffmpeg handle it without waiting for libsox to fail, if the `format="mp3"`
Loading and querying file-like object is not possible to use the fallback mechanism introduced in #2419 because file-like objects are not seekable. This commit add special case handling to mp3. For filelike object mp3 input, it was required to pass `format="mp3"` because libsox did not auto detect the format. With the transition of mp3 handling from libsox to ffmpeg, the logic is to let the ffmpeg handle it without waiting for libsox to fail, if the `format="mp3"`
Loading and querying file-like object is not possible to use the fallback mechanism introduced in pytorch#2419 because file-like objects are not seekable. This commit add special case handling to mp3. For filelike object mp3 input, it was required to pass `format="mp3"` because libsox did not auto detect the format. With the transition of mp3 handling from libsox to ffmpeg, the logic is to let the ffmpeg handle it without waiting for libsox to fail, if the `format="mp3"`
Summary: Loading and querying file-like object is not possible to use the fallback mechanism introduced in #2419 because file-like objects are not seekable. This commit add special case handling to mp3. For filelike object mp3 input, it was required to pass `format="mp3"` because libsox did not auto detect the format. With the transition of mp3 handling from libsox to ffmpeg, the logic is to let the ffmpeg handle it without waiting for libsox to fail, if the `format="mp3"` Note: This is back port of #2477. Pull Request resolved: #2478 Reviewed By: carolineechen Differential Revision: D37177123 Pulled By: mthrok fbshipit-source-id: 997eead01c0ad1f04ffa0daa1039302a75f62b63
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
In pytorch#2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting pytorch#2416 (fd7ace1).
Summary: In #2419, we added ffmpeg as fallback for sox_io backend. The was a warkaround for solving the issue with libmad removal. Now that we introduced `backend` argument to I/O functions, and libsox integration is moved to dynamic binding where users can use libsox with libmad integration, we do not need the workaround. This commit is based on reverting #2416 (fd7ace1). Pull Request resolved: #3516 Reviewed By: huangruizhe Differential Revision: D47855272 Pulled By: mthrok fbshipit-source-id: 5af73af7865f6e545ccb052d478e86588ff2a014
This commit add fallback mechanism to
info
andload
functions of sox_io backend.If torchaudio is compiled to use FFmpeg, and runtime dependencies are properly loaded,
in case
info
andload
fail, it fallback to FFmpeg-based implementation.BC-breaking changes:
Depends on