@echo on

..\_tools\x264 --crf 18 --profile main --level 4 --ref 1 --keyint 30 --bframes 0 --sar 1:1 -o intro.264 1__TITLE-vid_to-append__w-sound.avi

..\_tools\ffmpeg -i 1__TITLE-vid_to-append__w-sound.avi -acodec pcm_s16le -ac 2 ..\_tools\QAAC-255-port\audio.wav
cd ..\_tools\QAAC-255-port
QAAC\qaac audio.wav --cbr 256 --no-delay -o intro_qaac_cbr256.m4a
move intro_qaac_cbr256.m4a ..\..\1080-example\
del /q audio.wav
cd ..\..\1080-example

..\_tools\ffmpeg -i intro_qaac_cbr256.m4a -acodec copy intro_qaac_cbr256.aac
..\_tools\ffmpeg -i intro.264 -i intro_qaac_cbr256.aac -bsf:a aac_adtstoasc -vcodec copy -acodec copy intro-w-sound.mp4




..\_tools\ffmpeg -f concat -i 3__Join-FFMPEG_list_(optional).txt -c copy RESULT__w-sound.mp4





rem ..\_tools\ffmpeg -i intro-w-sound.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
rem ..\_tools\ffmpeg -i 2__ORIG-vid.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
rem ..\_tools\ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc RESULT-test__with-sound.mp4

del /q intermediate?.ts
del /q intermediate??.ts
del /q intermediate???.ts
del /q intermediate????.ts
del /q *.264
del /q *.h264
del /q intro.mp4
del /q *.aac
del /q *.m4a
del /q intro-w-sound.mp4
