Search code examples
audioffmpegencodetrim

FFmpeg: difference between atrim = a: b and aselect = 'between (t, a, b)'


I am starting to learn about ffmpeg and there is an unknown problem so use atrim=a:b or aselect='between(t, a,b)' when you want to trim an audio. What is the difference between them?


Solution

  • atrim=a:b will select starting with timestamp a but drop frames with timestamp b or greater.

    aselect='between(t,a,b)' will select starting with timestamp a; it will select frame with timestamp b but drop all frames with a timestamp greater than b.

    Other than that, they are similar. Timestamps of selected frames will not be reset to start with 0 in either filter.