I am having a similar issue as referenced here, but it seems I am doing everything right and still this happens. Here is the faulty part my code, with the goal to convert from one file format to another with ffmpeg:
set subfolder=converted
set source_ext=.avi
set target_ext=.mov
md %subfolder%
set path=%~dp0
setlocal enabledelayedexpansion
FOR %%I IN ("*!source_ext!") DO (
echo 1 %%I
set this_file=%%I
echo 2 !this_file!
set filename_new=!!this_file:%source_ext%=!!
set output=!path!%subfolder%\!filename_new!!target_ext!)
%ffmpegpath%\ffmpeg.exe -i "!this_file!" -vcodec copy -acodec copy "!output!"
echo CONVERTED !this_file!
)
The output I am looking for is this:
1 file1.ext
2 file1.ext
CONVERTED file1.ext
1 file2.ext
2 file2.ext
CONVERTED file2.ext
1 file3.ext
2 file3.ext
CONVERTED file3.ext
What I get, strangely, is this:
1 file1.ext
2 file1.ext
1 file2.ext
2 file2.ext
1 file3.ext
2 file3.ext
CONVERTED file3.ext
I am stumped!