Timeline for Possible to force FFmpeg to omit silence in audio files and produce discontinuous `webm`/`mka`?
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 15, 2023 at 14:06 | comment | added | Vadim Kantorov | Also, maybe the leakage is related to some silenceremove filter options I used above? But given the strangeness of such leakage, I suspect that somehow some packets of the 880hz-segment get incorrect timestamps assigned which forces them to be played before the 1h-long silence/gap | |
Dec 15, 2023 at 12:00 | comment | added | Vadim Kantorov | Thank you! However, this leakage is quite long - a full second :( I hope my repro above will help! | |
Dec 15, 2023 at 5:42 | comment | added | Gyan | Probably to do with the attack/release used by the filter. Will have to debug when I have time. | |
Dec 14, 2023 at 17:15 | comment | added | Vadim Kantorov |
I converted the input 5sec_silent1h_5sec.wav to be 48khz (in my original code above it was 44.1khz), but it made no difference - still leakage
|
|
Dec 14, 2023 at 16:19 | comment | added | Vadim Kantorov |
Thanks for helping out with this :) I've just tried your updated proposal using ffmpeg 6.1 static bits from johnvansickle.com/ffmpeg, the duration turns correct, but it has the same leakage/wrong pts problem as my attempts with aselect filter :(
|
|
Dec 14, 2023 at 16:14 | comment | added | Gyan | Updated answer. See at the end. | |
Dec 14, 2023 at 16:14 | history | edited | Gyan | CC BY-SA 4.0 |
mention option and ffmpeg version needed.
|
Dec 14, 2023 at 14:48 | comment | added | Vadim Kantorov |
The good duration of 5sec_silent1h_5sec.opus and bad duration of 5sec_5sec.mkv are confirmed by ffprobe (1h10s and 10s respectively)
|
|
Dec 14, 2023 at 14:47 | comment | added | Vadim Kantorov |
Here is a repro: ffmpeg -y -f lavfi -i sine=f=440:d=5 -f lavfi -i anullsrc=d=3600:cl=mono -f lavfi -i sine=f=880:d=5 -filter_complex "[0][1][2]concat=n=3:v=0:a=1" 5sec_silent1h_5sec.wav; ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus 5sec_silent1h_5sec.opus; ffmpeg -y -i 5sec_silent1h_5sec.wav -acodec libopus -af silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0 5sec_5sec.mkv
|
|
Dec 14, 2023 at 14:46 | comment | added | Vadim Kantorov |
I tested the silenceremove solution. Unfortunately, it does not create gaps and it changes the duration of the audio - this is not what I need. I'd like to simply drop the silent packets from the stream, but preserve the timestamps and keep the audio duration and have the dropped packets be replaced by digital silence at decoding time.
|
|
Dec 9, 2023 at 10:58 | comment | added | Vadim Kantorov |
silenceremove does not affect any timestamps and they stay original (as if no gaps were introduced), right? My goal is to have the encoded file have the same duration as before encoding (and have silence imputed by zeros at decoding time). Do you know if gaps are supported by webm /mka ? Am I correct that ogg does not support gaps? Would you have an advice of how to instruct ffmpeg to encode separately .wav streams / in a decoupled mode (for phone call recordings, there are long periods of silence if one considers every channel separately)?
|
|
Dec 9, 2023 at 10:45 | comment | added | Gyan | silenceremove can only remove data; it doesn't consolidate gaps. | |
Dec 9, 2023 at 9:52 | comment | added | Vadim Kantorov |
Would silenceremove produce such output with gaps? Or would it "collapse" the gaps and make the wall-clock-duration shorter? This was my misunderstanding while originally reading its documentation which led my to asking this question.
|
|
Dec 9, 2023 at 4:31 | history | answered | Gyan | CC BY-SA 4.0 |