mp3list-1.txt
contain the full patch to the mp3
files that will be concatenated
mp4list-1.txt
contain full path to the mp4
files that will be concatenated
then both results mergedmp34.mp3
and mergeMp4.mp4
should be combined together in a final MP4 video file with a random name.
something I do wrong I don't understand what
my guess I do something wrong on FOR
loop.
sometimes my .txt files contain full path to a single file mp4 or mp3
if don't have what to combine will concatenate 1 single file?
set exportdir=
set batsource= the place where this batch file is
1< mp3list-1.txt 2< mp4list-1.txt (
FOR %%A in ("%batsource%") DO (
set /p mp3list=" <&1
set /p mp4list=" <&2
ffmpeg -f concat -safe 0 -i "!mp3list!" -c copy mergedmp34.mp3
ffmpeg -f concat -safe 0 -i "!mp4list!" -c copy mergeMp4.mp4
ffmpeg -i mergedmp34.mp3 -i mergeMp4.mp4 -map 0:v -map 1:a -vcodec copy -c:a aac -b:a 320k "%exportdir%\%RANDOM%.mp4"
del mergedmp34.mp3
del mergeMp4.mp4
)
)
mp4list-1.txt
F:\.....Videos-115\output-mp4.txt
F:\....\Videos-1150\output-mp4.txt
F:\.....\Videos-1151\output-mp4.txt
F:\......Videos-1152\output-mp4.txt
mp3list-1.txt
F:\......audio-52\output-mp3.txt
and .txt with direct files are like:
file 'F:\....00OH7011.mp3'
file 'F:\....00OH7011.mp3'
file 'F:\....00OH7011.mp3'
and for videos
file 'F:\....00OH7011.mp4'
file 'F:\....00OH7011.mp4'
file 'F:\....00OH7011.mp4'
Later Edit
basically, I want to adapt to my needs the above script based on this working
script bellow where I have 4 txt files that are looped.
mkdir ".\Export"
set "sourcedir="
set "outputdir=Export"
1< codfundal.txt 2< fontalbum.txt 3< album.txt 4< artist.txt (for %%F in (*.jpg *.jpeg) do (
set /P "artist=" <&4
set /P "fontalbum="<&2
set /P "album=" <&3
set /P "codfundal=" <&1
magick convert -gamma 1 -contrast 30 %%F -fill white -undercolor "!codfundal!" -gravity Center -font "!fontalbum!" -pointsize 215 -annotate +0+5 "!album!" -gravity Center -pointsize 120 -font "Calibri-Bold" -annotate +0+220 "!artist!" -crop 1440x1440+0+0 -quality 92 "%outputdir%\%%F"
)
)
album.txt
Circumferential
Genealogy
Iraqi
Fitters
artist.txt
Bhaskar Punk
Costas Fourie
Sonja Bryan
Jin Gullberg
codfundal.txt
#E70E0E
#ff00ff
#993366
#99cc00
#cc99ff
fontalbum.txt
Bauhaus-93
Agency-FB
Bernard-MT-Condensed
Bodoni-MT
I made it work; hope will help someone as SO community helped me so much in my process of learning batch files... and still learning.
I used
for /F "delims=" %%A in (mp3list-1.txt)
3<"numepiese.txt" 4<"mp4list-1.txt" ( for /F "delims=" %%A in (mp3list-1.txt) DO (
set /p numepiese=<&3
set /p mp4list=<&4
ffmpeg -f concat -safe 0 -i "%%A" -c copy mergemp3-list-1.mp3
ffmpeg -f concat -safe 0 -i "!mp4list!" -c copy mergeMp4-list-1.mp4
ffmpeg -i mergeMp4-list-1.mp4 -i mergemp3-list-1.mp3 -map 0:v -map 1:a -vcodec copy -c:a aac -b:a 320k "%exportdir%-%n%\!numepiese!.mp4"
del mergemp3-list-1.mp3
del mergeMp4-list-1.mp4
)
)