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

Mark Filipak markfilipak.imdb at gmail.com
Sun Jul 27 17:21:42 EEST 2025


Hi, Reino, this is off-list.

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"
start 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"
start ffmpeg -y -safe 0 -i "%_JOB_%CONCATa1.txt" "%_DELAYEDa1_%"

On 27/07/2025 07.00, Reino Wijnsma via ffmpeg-user wrote:
> Hello Mark,
> 
> 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]"

I think you mean this:
SET JOB="D:\work\MISS PETTIGREW LIVES FOR A DAY [2007]"

The quotes are not needed, and their presence creates problems later.
The quotes are only needed at the end, in the FFmpeg command.

> But why so many unneccesary variables?...

The variable names document what the step does (e.g. _DELAY2CH_) or what
the file is (e.g. _SOURCEa0_, _DELAYEDa0_). The goal is to keep the
FFmpeg command line from wrapping, in email for example.

ffmpeg -y -safe 0 -i "%_JOB_%CONCATa0.txt" "%_DELAYEDa0_%"

And the reason I put tokens in all-caps and with leading and trailing
underscores is so that they stand out (e.g. %_JOB_%).

>... Also the creation of the 
> ffconcat-file can be done more efficiently...

Efficiency often matters, but not in this case. It's readability that
matters here.

Thanks for your thoughts. I appreciate your passion to help!--Mark.



More information about the ffmpeg-user mailing list