The ffmpeg script below for an xfade filter works as expected in the batch command, but the second script in powershell fails. The issue appears to be that the set variables are not being entered.
I’ve tried various methods of surrounding the variables in quotes, brackets etc, but none seem to work. What am I missing?
Batch:
set F=fade
set D=2
set OFF=3
ffmpeg -i 5.mkv -i 10.mkv -filter_complex [0][1]xfade=transition=%F%:duration=%D%:offset=%OFF% -c:v libx264 -pix_fmt yuv420p -an -r 25 -an out.mkv
Pause
Powershell:
$F=fade
$D=2
$OFF=3
ffmpeg -i 5.mkv -i 10.mkv -filter_complex [0][1]xfade=transition=$F:duration=$D:offset=$OFF -c:v libx264 -pix_fmt yuv420p -an -r 25 -an out.mkv
Read-Host
Output from terminal.
fade : The term 'fade' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At H:XFADEXfade x 3 (No Audio).ps1:2 char:4
+ $F=fade
+ ~~~~
+ CategoryInfo : ObjectNotFound: (fade:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
ffmpeg version 2026-08-06-git-95c43d7df7-full_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers
built with gcc 16.1.0 (Rev2, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-cairo --enable-fontconfig --enable-iconv --enable-gnutls --enable-lcms2 --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-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 --enable-libsvtjpegxs --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --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-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 --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint --enable-whisper
libavutil 61. 5.100 / 61. 5.100
libavcodec 63. 7.100 / 63. 7.100
libavformat 63. 5.101 / 63. 5.101
libavdevice 63. 2.100 / 63. 2.100
libavfilter 12. 3.101 / 12. 3.101
libswscale 10. 2.100 / 10. 2.100
libswresample 7. 2.100 / 7. 2.100
[Parsed_xfade_0 @ 00000235ad464400] const_values array too small for transition
[fc#0 @ 00000235ad462c40] Error applying option 'transition' to filter 'xfade': Not yet implemented in FFmpeg, patches welcome
Error : Not yet implemented in FFmpeg, patches welcome