TheMetalCenter / m4b-mp3-chapters-from-cuesheets

merge audiobooks or podcasts without re-encoding (remuxing only) to single m4b with quicktime/nero chapters or mp3 with id3v2 chapters using cuesheets; also allows for renaming/editing chapters
23 stars 0 forks source link

Preserving metadata from the first input file when concating #5

Closed TheMetalCenter closed 2 years ago

TheMetalCenter commented 2 years ago

Currently metadata from the original split files is lost when concating because ffmpeg doesn't know to grab from first file when using a list of files as input.

This is a convoluted method (using rxrepl as a search and replace engine) that seems to work to get around this, but going to test more before comit. The original ffmpeg string is just commented out so it can be easily restored if necessary.

call direnhanced_mp3.bat > fileList.txt set /p meta=< fileList.txt echo %meta% > meta1.txt rxrepl.exe -f meta1.txt -o meta2.txt -s "file \'" -r """ rxrepl.exe -f meta2.txt -o meta3.txt -s ".mp3'" -r ".mp3"" set /p inputmeta=< meta3.txt ffmpeg -i %inputmeta% -f ffmetadata metadatatemp.txt ffmpeg -f concat -safe 0 -i fileList.txt -i metadatatemp.txt -map 0 -map_metadata 1 -c copy input.mp3 ::ffmpeg -f concat -safe 0 -i fileList.txt -c copy input.mp3 del fileList.txt del metadatatemp.txt del meta1.txt del meta2.txt del meta3.txt pause