[FFmpeg-user] Concat command for ffmpeg fails "Unsafe file name" - why?

Bo Berglund bo.berglund at gmail.com
Thu Mar 16 11:59:07 EET 2023

I have written a utility on Ubuntu which extracts sections from a video mp4 file
using ffmpeg and then combines them into a final combined video.

It has been working fine for years but it relies on everthing happening in a
single directory so I have tried to modify it such that it can use file
locations elsewhare on the file system too.

Now tested the full utility and I get an error in the final step where the
output shall be the end product video.

This is what I send into ffmpeg:

ffmpeg -hide_banner -f concat -i ./_filelist_.txt -c copy ./Test.out.mp4

The file list contains this:

file './tmp-1.mp4'
file './tmp-2.mp4'
file './tmp-3.mp4'
file './tmp-4.mp4'
file './tmp-5.mp4'

What I get when I run the command is this:

$ ffmpeg -hide_banner -f concat -i ./_filelist_.txt -c copy ./Test.out.mp4
[concat @ 0x55d3e78a0580] Unsafe file name './tmp-1.mp4'
./_filelist_.txt: Operation not permitted

What is the reason for this when the tmp files obviously are created just fine
using ffmpeg in an earlier step???

I have tried to edit _filelist_.txt by writing the full path for each tmp file
but it still complains!

[concat @ 0x55760e61b580] Unsafe file name
./_filelist2_.txt: Operation not permitted

What can be done about it?

Bo Berglund
Developer in Sweden

More information about the ffmpeg-user mailing list