ffmpeg: concat without temp files?
If I understand the question correctly: yes! You can create a file that is a concatenation of different parts of the input video.
The script you're looking for is something like:
ffmpeg \
-i &quot;$INPUT_FILE&quot; \
-filter_complex \
&quot;[0:v]trim=start=5:duration=10,setpts=PTS-STARTPTS[v0]; \
 [0:a]atrim=start=5:duration=10,asetpts=PTS-STARTPTS[a0]; \
 [0:v]trim=start=20:duration=10,setpts=PTS-STARTPTS[v1];
 [0:a]atrim=start=20:duration=10,asetpts=PTS-STARTPTS[a1]; \
 [v0][a0][v1][a1]concat=n=2:v=1:a=1[final]&quot; \
-map &quot;[final]&quot; concat-video.mp4

You can read a little bit more about this on this blog post
(Disclaimer: I'm one of the co-founder of https://mediamachine.io)
Hope this helps!