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

Mark Filipak markfilipak.imdb at gmail.com
Sun Jul 27 02:17:51 EEST 2025


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.

Note: This is using Gyan's latest git build.

Workaround: Use 'start ffmpeg' instead of 'ffmpeg'. That causes the two
invocations to run in separate terminal sessions (but note that they
then run concurrently instead of sequentially).

I will not submit this as a bug until it's been replicated.

This requires some set up.
%_JOB_%DELAY2CH.ac3 and %_JOB_%DELAY6CH.ac3 are 33 frames of silence,
created by the first script.
%_JOB_%a0.ac3 is an existing 2.0 ac3 file.
%_JOB_%a1.ac3 is an existing 5.1 ac3 file.
%_JOB_%CONCATa0.txt and %_JOB_%CONCATa1.txt are created.
%_JOB_%DELAYEDa0.ac3 and %_JOB_%DELAYEDa1.ac3 are created.

    : set _JOB_=<d:\path\name>
set _JOB_=c:\work\MISS PETTIGREW LIVES FOR A DAY [2007]
set _DELAY2CH_=%_JOB_%DELAY2CH.ac3
set _DELAY6CH_=%_JOB_%DELAY6CH.ac3
set _SILENCE2_=anullsrc=channel_layout=2:sample_rate=48000
set _SILENCE6_=anullsrc=channel_layout=5.1:sample_rate=48000
set _33FRAMES_=1.376375
ffmpeg -f lavfi -i %_SILENCE2_% -t %_33FRAMES_% -c ac3 "%_DELAY2CH_%"
ffmpeg -f lavfi -i %_SILENCE6_% -t %_33FRAMES_% -c ac3 "%_DELAY6CH_%"


The following works:
(Note the use of 'start' commands. )

    : set _JOB_=<d:\path\name>
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_%"


The following screws up as described in PREFACE:

    : set _JOB_=<d:\path\name>
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_%"

Here is the 'screw-up's terminal output:
(Note these lines:
(Enter command: <target>|all <time>|-1 <command>[ <argument>]
(
(Parse error, at least 3 arguments were expected, only 1 given in string
'ho file '
('%_SOURCEa1_%'>>"%_JOB_%CONCATa1.txt"')

C:\Windows\System32>set _JOB_=c:\work\MISS PETTIGREW LIVES FOR A DAY [2007]
C:\Windows\System32>set _DELAY2CH_=%_JOB_%DELAY2CH.ac3
C:\Windows\System32>set _DELAY6CH_=%_JOB_%DELAY6CH.ac3
C:\Windows\System32>set _SOURCEa0_=%_JOB_%a0.ac3
C:\Windows\System32>set _SOURCEa1_=%_JOB_%a1.ac3
C:\Windows\System32>set _DELAYEDa0_=%_JOB_%DELAYEDa0.ac3
C:\Windows\System32>set _DELAYEDa1_=%_JOB_%DELAYEDa1.ac3
C:\Windows\System32>echo ffconcat version 1.0>"%_JOB_%CONCATa0.txt"
C:\Windows\System32>echo file '%_DELAY2CH_%'>>"%_JOB_%CONCATa0.txt"
C:\Windows\System32>echo file '%_SOURCEa0_%'>>"%_JOB_%CONCATa0.txt"
C:\Windows\System32>ffmpeg -y -safe 0 -i "%_JOB_%CONCATa0.txt"
"%_DELAYEDa0_%"
ffmpeg version 2025-07-23-git-829680f96a-full_build-www.gyan.dev
Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 15.1.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-lc
ms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma
--enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enabl
e-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav
--enable-libdvdread --enable-sdl2 --enable-libaribb24
--enable-libaribcaption --enable-libdav1d --enab
le-libdavs2 --enable-libopenjpeg --enable-libquirc --enable-libuavs3d
--enable-libxevd --enable-libzvbi --enable-liboapv --enable-libqrencode
--enable-librav1e --enable
-libsvtav1 --enable-libvvenc --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid
--enable-libaom --enable-libjxl --en
able-libvpx --enable-mediafoundation --enable-libass --enable-frei0r
--enable-libfreetype --enable-libfribidi --enable-libharfbuzz
--enable-liblensfun --enable-libvidst
ab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
--enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va
--enable-ffnvcodec --enable-libvpl
--enable-nvdec --enable-nvenc --enable-vaapi --enable-libshaderc
--enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio
--enable-openal --enable-libgme --
enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb
--enable-libmp3lame --enable-libshine --enable-libtheora
--enable-libtwolame --enable-libvo-amrwbenc --
enable-libcodec2 --enable-libilbc --enable-libgsm --enable-liblc3
--enable-libopencore-amrnb --enable-libopus --enable-libspeex
--enable-libvorbis --enable-ladspa --ena
ble-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband
--enable-libsoxr --enable-chromaprint
  libavutil      60.  6.100 / 60.  6.100
  libavcodec     62.  8.100 / 62.  8.100
  libavformat    62.  1.103 / 62.  1.103
  libavdevice    62.  0.100 / 62.  0.100
  libavfilter    11.  3.100 / 11.  3.100
  libswscale      9.  0.100 /  9.  0.100
  libswresample   6.  0.100 /  6.  0.100
[ac3 @ 0000000002632900] Estimating duration from bitrate, this may be
inaccurate
Input #0, concat, from 'c:\work\MISS PETTIGREW LIVES FOR A DAY
[2007]CONCATa0.txt':
  Duration: N/A, start: 0.000000, bitrate: 192 kb/s
  Stream #0:0: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (ac3 (native) -> ac3 (native))
Press [q] to stop, [?] for help
Output #0, ac3, to 'c:\work\MISS PETTIGREW LIVES FOR A DAY
[2007]DELAYEDa0.ac3':
  Metadata:
    encoder         : Lavf62.1.103
  Stream #0:0: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      encoder         : Lavc62.8.100 ac3
[ac3 @ 000000000269d080] Estimating duration from bitrate, this may be
inaccurate
size=    2816KiB time=00:02:02.77 bitrate= 187.9kbits/s speed= 242x
elapsed=0:00:00.50
Enter command: <target>|all <time>|-1 <command>[ <argument>]

Parse error, at least 3 arguments were expected, only 1 given in string
'ho ffconcat version 1.0>"%_JOB_%CONCATa1.txt"'
size=    8192KiB time=00:05:54.97 bitrate= 189.1kbits/s speed= 229x
elapsed=0:00:01.55
Enter command: <target>|all <time>|-1 <command>[ <argument>]

Parse error, at least 3 arguments were expected, only 1 given in string
'ho file '%_DELAY6CH_%'>>"%_JOB_%CONCATa1.txt"'
size=   13824KiB time=00:10:00.60 bitrate= 188.6kbits/s speed= 231x
elapsed=0:00:02.59
Enter command: <target>|all <time>|-1 <command>[ <argument>]

Parse error, at least 3 arguments were expected, only 1 given in string
'ho file '%_SOURCEa1_%'>>"%_JOB_%CONCATa1.txt"'
[out#0/ac3 @ 0000000001ccbcc0] video:0KiB audio:129039KiB subtitle:0KiB
other streams:0KiB global headers:0KiB muxing overhead: 0.000000%
size=  129039KiB time=01:31:45.65 bitrate= 192.0kbits/s speed= 227x
elapsed=0:00:24.22


More information about the ffmpeg-user mailing list