-
Notifications
You must be signed in to change notification settings - Fork 3.1k
audio/filter: implement ffscaletempo leveraging lavfi's atempo/ascale #16853
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
base: master
Are you sure you want to change the base?
Conversation
Download the artifacts for this pull request: Windows |
Why not just use |
@sfan5 Because of the timestamps/sync! |
nitpick about naming, I would rather use |
That can be changed. But I will wait for more feedback (if any) first. I didn't choose |
The point is ffmpeg is CLI tool, which is carried to the project name, but you are not really using ffmpeg here. But whatever really. |
Scales audio tempo using ``atempo`` or ``ascale`` filters from FFmpeg's | ||
libavfilter. | ||
|
||
If ``ascale`` (Librempeg only) is not available in the loaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of mentioning home grown ffmpeg forks, just say it accepts filters like atempo so you don't have to go around documenting every fork that implements a pitch correction filter in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I opted to support specific filters because I can, and did, test them.
- Non filter-specific support will require making both the filter name and filter tempo argument exposed to users.
ascale
andatempo
just happened to use the same argument, and if they didn't, it's a minor code change. Non filter-specific support would add too much flexibility, complexity, and as a result non-reliability, IMHO. - This filter obviously doesn't add build-time or run-time dependency on librempeg. It just optionally supports internally a filter implemented there if available at run-time, like you can optionally pass such filters with
lavfi=<some_filter>
.
Renamed to |
Implement `lavfi-tempo` audio filter, which uses `atempo` or `ascale` form libavfilter for setting the tempo. Users (myself included) seem to be always looking for alternative tempo scalers to try, and this provides a faster implementation (or two), and may prove useful beyond performance/speed. `atempo` is picked as a default, and as a fall-back if `ascale` is not available. Signed-off-by: Mohammad AlSaleh <[email protected]>
Simplified the code so the out frame just gets its PTS from the in frame directly, so no special handling is needed in case of pts jumps, and no filter resets are needed if the speed changes. This assumes "1 frame in, 1 frame out" between pins will always hold true, which seems to be the case. |
I've seen this come up the other day, and it piqued my interest. It's in a "WORKS FOR ME" state. But I'm not familiar with this filter code. Feedback and/or testing would be appreciated.
Implement
ffscaletempo
audio filter, which usesatempo
orascale
form libavfilter for setting the tempo.
Users (myself included) seem to be always looking for alternative tempo
scalers to try, and this provides a faster implementation (or two), and
may prove useful beyond performance/speed.
atempo
is picked as a default, and as a fall-back ifascale
is notavailable.