I'm curious, is it possible to do frame-perfect audio cutting using ffmpeg's complex filter graphs + frame filtering aselect
functionality?
I've tried a bunch of other approaches (using -segment_times
and -ss
/-t
) - they worked but were only ~0.02sec
accurate, just for reference:
ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" -ar 48000 test.wav
ffmpeg -y -i test.wav -f segment -segment_times "1.55,2.00" -segment_list_type csv -segment_list output.csv test%04d.opus
ffmpeg -y -i test.wav -ss 0.00 -t 1.55 test0000.opus -ss 2.00 -t 1.00 test0001.opus
My filter-based attempts:
ffmpeg -y -i test.wav -ar 48000 -af "aselect=between(samples_n\,100\,16100)" test0000.opus
as an example but this produces a 5-second longtest0000.opus
instead of a 0.25-second oneffmpeg -y -i test.wav -ar 48000 -af "aselect=between(t\,0.0\,1.55)" test0000.opus
kind of works, but still gives a 1.57-second audio instead of 1.55-second one.
Can this be done in principle using frame filtering? Am I missing something in these commands above? If the filter-based approach is not more accurate, I will fall back to my initial attempts.
Thanks!