[FFmpeg-user] It appears that FFmpeg is slipping into command mode

Reino Wijnsma rwijnsma at xs4all.nl
Sun Jul 27 14:00:24 EEST 2025


Hello Mark,

On 2025-07-27T01:17:51+0200, Mark Filipak <markfilipak.imdb at gmail.com> 
wrote:
> PREFACE: It appears that FFmpeg is slipping into command mode, taking
> the next couple letters from stdin, and interpreting them. That screws
> up the remaining script of course.
You do realize this is totally off-topic for this mailinglist?
But fine, I'll bite.

> set JOB=c:\work\MISS PETTIGREW LIVES FOR A DAY [2007]
> set DELAY2CH=%JOB%DELAY2CH.ac3
> set DELAY6CH=%JOB%DELAY6CH.ac3
> set SOURCEa0_=%_JOB%a0.ac3
> set SOURCEa1_=%_JOB%a1.ac3
> set DELAYEDa0_=%_JOB%DELAYEDa0.ac3
> set DELAYEDa1_=%_JOB%DELAYEDa1.ac3
> echo ffconcat version 1.0>"%JOB%CONCATa0.txt"
> echo file '%DELAY2CH%'>>"%JOB%CONCATa0.txt"
> echo file '%SOURCEa0_%'>>"%_JOB%CONCATa0.txt"
> ffmpeg -y -safe 0 -i "%JOB%CONCATa0.txt" "%_DELAYEDa0_%"
> echo ffconcat version 1.0>"%JOB%CONCATa1.txt"
> echo file '%DELAY6CH%'>>"%JOB%CONCATa1.txt"
> echo file '%SOURCEa1_%'>>"%_JOB%CONCATa1.txt"
> ffmpeg -y -safe 0 -i "%JOB%CONCATa1.txt" "%_DELAYEDa1_%" 
%_JOB% doesn't exist.
%_DELAYEDa0_% doesn't exist.
%_DELAYEDa1_% doesn't exist.

I would recommend quoting your variables when spaces are involved.
The following works for me:

SET "JOB=D:\work\MISS PETTIGREW LIVES FOR A DAY [2007]"
SET "DELAY2CH=%JOB%DELAY2CH.ac3"
SET "DELAY6CH=%JOB%DELAY6CH.ac3"
SET "SOURCEa0=%JOB%a0.ac3"
SET "SOURCEa1=%JOB%a1.ac3"
SET "DELAYEDa0=%JOB%DELAYEDa0.ac3"
SET "DELAYEDa1=%JOB%DELAYEDa1.ac3"
echo ffconcat version 1.0>"%JOB%CONCATa0.txt"
echo file '%DELAY2CH%'>>"%JOB%CONCATa0.txt"
echo file '%SOURCEa0%'>>"%JOB%CONCATa0.txt"
ffmpeg -y -safe 0 -i "%JOB%CONCATa0.txt" "%DELAYEDa0%"
echo ffconcat version 1.0>"%JOB%CONCATa1.txt"
echo file '%DELAY6CH%'>>"%JOB%CONCATa1.txt"
echo file '%SOURCEa1%'>>"%JOB%CONCATa1.txt"
ffmpeg -y -safe 0 -i "%JOB%CONCATa1.txt" "%DELAYEDa1%"

But why so many unneccesary variables? Also the creation of the 
ffconcat-file can be done more efficiently. How about:

SET "JOB=D:\work\MISS PETTIGREW LIVES FOR A DAY [2007]"
(FOR %%A IN ("%JOB%DELAY2CH.ac3" "%JOB%a0.ac3") DO @ECHO file '%%~A') > 
"%JOB%CONCATa0.txt"
ffmpeg -y -safe 0 -f concat -i "%JOB%CONCATa0.txt" "%JOB%DELAYEDa0.ac3"
(FOR %%A IN ("%JOB%DELAY6CH.ac3","%JOB%a1.ac3") DO @ECHO file '%%~A') > 
"%JOB%CONCATa1.txt"
ffmpeg -y -safe 0 -f concat -i "%JOB%CONCATa1.txt" "%JOB%DELAYEDa1.ac3"

-- 
Reino


More information about the ffmpeg-user mailing list