Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
30th May 2023, 04:55 | #1 | Link |
Chiptuner & VapourSynther
Join Date: Mar 2019
Location: Scarlet Devil Mansion, Gensōkyō
Posts: 52
|
How to do nearest-neighbor audio upsampling in FFmpeg?
Hello,
I have hundreds of one-minute-long MP4 files ripped from a WYZE security camera, & their monaural audio is encoded in A-Law ADPCM at 16000 Hz. I want to batch-decode the audio from all those 100s of MP4s to PCM (16-bit signed, little endian) & then batch-upsample from 16000 to 48000 Hz WITHOUT interpolation of any kind – that is, nearest-neighbor upsampling (instead of linear, cubic, or any other form of sample interpolation), & because 48000 is an integer multiple of 16000 (3× to be exact), the output should have no rounding errors. Effectively, I want each input sample value to repeat three times at the output before moving from one audio sample point to the next. The question is, how do I batch-do this in FFmpeg? For context: trying FFmpeg’s -ar 48000 option always results in linear interpolation (or something close to it) between sample points, & trying instead Code:
-af aresample=isr=16000:linear_interp=0:osr=48000
__________________
SilSinn9801 a.k.a. Silent Sinner in Scarlet Discord: silsinn9801 Matrix: silsinn9821:matrix.org YouTube: https://youtube.com/SilentSinnerInScarlet ニコニコ動画: https://nicovideo.jp/user/68029427 Last edited by SilSinn9801; 30th May 2023 at 05:13. Reason: adding for context the behavior of both "-ar 48000" & "-af aresample" options in FFmpeg; fixing formatting from [CODE/] to [FONT/] |
Tags |
ffmpeg audio, interpolation, nearest neighbor, nearest neighbour, upsampling |
Thread Tools | Search this Thread |
Display Modes | |
|
|