I'm curious, is it possible to do frame-perfect audio cutting using ffmpeg's complex filter graphs + frame filtering
I've tried a bunch of other approaches (using
-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.opusas an example but this produces a 5-second long
test0000.opusinstead of a 0.25-second one
ffmpeg -y -i test.wav -ar 48000 -af "aselect=between(t\,0.0\,1.55)" test0000.opuskind 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.