Question: I've 2 mp3 files. a.mp3 is 1000 seconds long and b.mp3 is 10 seconds long. I'd like to add b.mp3 to a.mp3 starting from 50s seconds, so the output will be 1010 seconds long.

How can I achieve it with FFmpeg? Is there any simple command-line way for that?

This seems to be an easy task, but I didn't find any solution on google.

Answer: 
atrim

```
ffmpeg -i "a.mp3" -i "b.mp3" -filter_complex "
[0:a]atrim=end=50,asetpts=PTS-STARTPTS[a1];
[0:a]atrim=start=50,asetpts=PTS-STARTPTS[a3];
[a1][1:a][a3]concat=n=3:v=0:a=1
" out.mp3

```
Create a new file `start_a.mp3` by using `a.mp3` and cutting it off at 50 seconds:

```
ffmpeg -i a.mp3 -t 50 start_a.mp3

```

Then create a file called `end_a.mp3` by isolating the other part of `a.mp3`:

```
ffmpeg -i a.mp3 -ss 50 end_a.mp3

```

Then concat these files with `b.mp3` in the middle:

```
ffmpeg -i start_a.mp3 -i b.mp3 -i end_a.mp3 -filter_complex [0:a][1:a][2:a]concat=n=3:v=0:a=1 output.mp3

```