<p>I'm running this ffmpeg command that does multiple trims on input video and concats those trims to generate output.</p>
<p><code>ffmpeg -i https://d8r14y803bnlk.cloudfront.net/usetldr/2736037/u/796/st/5a919413ff884892bbfffcd0671687a9/p/67c1a16438bf4bb78b785557f4cef7ef/OJx1SIKTNbbGHmQfKT4C_render.mp4 -filter_complex &quot;[0:v:0]trim=start=0.0:end=4.289,setpts=PTS-STARTPTS,format=yuva420p[0v];[0:v:0]trim=start=4.84:end=1034.7,setpts=PTS-STARTPTS,format=yuva420p[1v];[0v][1v]concat=n=2:v=1:a=0&quot; -crf 18 -an -preset ultrafast -y /tmp/8TZeqB3Z6h.mp4</code></p>
<p>This command works fine on my M1 mac but hangs EC2 instances (c5.4xlarge).</p>
<p>I'm using <code>ffmpeg version 6.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2023 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6)</code>  on EC2.</p>
<p>Any idea why this could be happening?</p>

CC BY-SA 4.0
2023-12-16T00:07:01.397Z
came across this thread https://video.stackexchange.com/a/27713/20745 where the user recommends using same input file multiple times ( that is, multiple -i switches with same file).

And it seems to work.

Does trim filter store all frames in RAM?
Tejas
CC BY-SA 4.0
2023-12-16T00:08:08.537Z
Is there any cleaner workaround for this?
Tejas
CC BY-SA 4.0
2023-12-16T04:47:25.417Z
There is `split` filter that can be used to write it in cleaner way.
Tejas
<ffmpeg><video>
machine hangs during ffmpeg command execution
Tejas
# machine hangs during ffmpeg command execution

(Asked by: username_0 on 2023-12-15)

I'm running this ffmpeg command that does multiple trims on input video and concats those trims to generate output.

`ffmpeg -i https://d8r14y803bnlk.cloudfront.net/usetldr/2736037/u/796/st/5a919413ff884892bbfffcd0671687a9/p/67c1a16438bf4bb78b785557f4cef7ef/OJx1SIKTNbbGHmQfKT4C_render.mp4 -filter_complex "[0:v:0]trim=start=0.0:end=4.289,setpts=PTS-STARTPTS,format=yuva420p[0v];[0:v:0]trim=start=4.84:end=1034.7,setpts=PTS-STARTPTS,format=yuva420p[1v];[0v][1v]concat=n=2:v=1:a=0" -crf 18 -an -preset ultrafast -y /tmp/8TZeqB3Z6h.mp4`

This command works fine on my M1 mac but hangs EC2 instances (c5.4xlarge).

I'm using `ffmpeg version 6.1-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2023 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6)` on EC2.

Any idea why this could be happening?

**Tags:** ffmpeg, video

> **Comments:**
> **username_0**: came across this thread https://video.stackexchange.com/a/27713/20745 where the user recommends using same input file multiple times ( that is, multiple -i switches with same file).  And it seems to work.  Does trim filter store all frames in RAM?  
> **username_0**: Is there any cleaner workaround for this?  
> **username_0**: There is `split` filter that can be used to write it in cleaner way.  

---

## 0 answers

