putnam / binmerge Goto Github PK
View Code? Open in Web Editor NEWTool to merge multiple bin/cue tracks into one. Great for redump.
License: GNU General Public License v2.0
Tool to merge multiple bin/cue tracks into one. Great for redump.
License: GNU General Public License v2.0
Let me start by saying I love your script! It seems to work flawlessly. I do have one issue that you may or may not be able to change. When it creates the cue file it points to the full path of the bin. It would be nice if it only pointed at the file.
So instead of it pointing at this is\the path
I admit this might be me not being good at batch.
I do this:
merge.bat
for %%A in ("%~1") do set "InputFileName=%%~nA"
binmerge.exe "%~1" "merged\%InputFileName%"
The problem is the .cue file ends up picking up the "merged" directory like so:
FILE "merged\file.bin" BINARY
When it should just be:
FILE "file.bin" BINARY
ANything i can do in batch to fix this or it's just how the .exe works?
What I was aiming for was to take the .cue and .bin in "input" folder, do the splitting, and then output both the .cue and .bin(s) to the "output" folder.
My batch is as follows:
set "CueFileName=%%~ni"
for %%i in (input\*.cue) do (binmerge -o output -s "%%i" "%CueFileName%")
and this does correctly split the files, however it only puts the new .cue file in the "output" folder, and just spits the .bin files next to the binmerge.exe rather than also in "output".
I'm not well versed so I'm not sure if it's because of my batch or if this is unintended behaviour?
I appreciate your program ๐
when i run binmerge I get the following message Non-ASCII character '\xe2' in file binmerge on line 23. also , what parameters are supposed to be fed to it. i just ran python binmerge from the terminal...
Hi,
I was trying to create a batch file in order to use your script quickly.
The batch file and the file [binmerge.py] are in the folder "C:\binmerge"
My bin files are in "C:\binmerge\Bins"
and I made a new folder "C:\binmerge\Merged"
(Not working) This is the content of the .bat Batch file:
for /r %%i in (*.cue) do binmerge.py "%%i" "%%~ni.merged" -o "%~dp0\Merged"
But it works with:
for /r %%i in (*.cue) do binmerge.py "%%i" "%%~ni.merged" -o "C:\binmerge\Merged"
There is no command line in readme to use the exe...
I'm getting this message when attempting to run master
with Python 3.12.1 on Windows
PS ...> binmerge.py
...\binmerge.py:122: SyntaxWarning: invalid escape sequence '\d'
m = re.search('TRACK (\d+) ([^\s]*)', line)
...\binmerge.py:128: SyntaxWarning: invalid escape sequence '\d'
m = re.search('INDEX (\d+) (\d+:\d+:\d+)', line)
...\binmerge.py:169: SyntaxWarning: invalid escape sequence '\d'
m = re.match("(\d+):(\d+):(\d+)", stamp)
usage: binmerge.py [-h] [-l] [-v] [-s] [-o OUTDIR] cuefile basename
binmerge.py: error: the following arguments are required: cuefile, basename
Seems like some of these strings are missing r
prefixes.
Hi Hope you are well.
I have been trying to convert a lot of my sets to CHD but want to make sure I can reverse the process. Some sets have two index's per audio section, which when used creates two bin's per track which then do not match the originals.
An example cuesheet is attached.
Is there a way to get binmerge to ignore the index's and just create one file per track?
Kind regards
Ian
The issue was with my batch files.
Hey there,
I found your utility via a 'gotbletu' video on YouTube:
https://www.youtube.com/watch?v=eJOO5tpWZU0
My current issue is that I am trying to merge two separate .bin files that were ripped for the "Dynasty Warriors 2" game into 1 .bin using the available .cue file present.
It appears to be erroring out on Line 98 where you are obtaining the size of the file itself using the 'os' library.
I am getting this error on a box using Fedora Server for reference.
Here's the output:
sam@fedoraserver ~/utilities/binmerge $ ls
binmerge 'Dynasty Warriors 2.cue' 'Dynasty Warriors 2 (Track 1).bin' 'Dynasty Warriors 2 (Track 2).bin' LICENSE README.md
sam@fedoraserver ~/utilities/binmerge $ ./binmerge 'Dynasty Warriors 2.cue' 'Dynasty Warriors 2'
[INFO] Opening cue: Dynasty Warriors 2.cue
Traceback (most recent call last):
File "/home/sam/utilities/binmerge/./binmerge", line 306, in <module>
if not main():
File "/home/sam/utilities/binmerge/./binmerge", line 266, in main
cue_map = read_cue_file(args.cuefile)
File "/home/sam/utilities/binmerge/./binmerge", line 109, in read_cue_file
this_file = File(os.path.join(os.path.dirname(cue_path), m.group(1)))
File "/home/sam/utilities/binmerge/./binmerge", line 98, in __init__
self.size = os.path.getsize(filename)
File "/usr/lib64/python3.9/genericpath.py", line 50, in getsize
return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: 'Dynasty Warriors 2 (USA) (Track 1).bin'
Thanks for the utility, looks cool!
Great work with the binmerge ๐
I had to google a while until I stumbled upon this:
How to use binmerge on Windows
Perhaps, this could be useful in the README for those using Win OS ๐
Initial tests show that a redump dreamcast .cue file has 2 remarks in it in the original cue file:
REM SINGLE-DENSITY AREA
before the first 2 tracks and
REM HIGH-DENSITY AREA
between track 2 and 3, track 3 and up being the bulk of the data
can there be a commandline switch added to -fixdccue or some such?
Firstly I must say thanks for making bin merge. Everything I was able to find on Google was windows specific. IsoBuster and the like. Even the answers to people asking about doing it on Linux were "go do it on windows" which I thought was awful. I only found binmerge after deciding to search GitHub specifically.
So thanks a bunch! Binmerge deserves more coverage! =D
One problem though. I would like to be able to return to the Redump.org format with the multiple bin files in order to verify against their dat files. So is there a binsplit?
i tried to merge bin files of arcus i, ii, iii for mega cd but as soon as i clicked on program it just opened and closed after few seconds
I've noticed binmerge
is careful enough to use a leading 0
when there are more than 10 tracks, to match Redump's naming convention. It could go one step further and not add the (Track %s)
at all if there is only a single track, so the BIN file has the same name as the CUE file.
Granted, one could argue that this is a no-op, as the output files would be identical to the input ones, so the solution would be simply not to invoke binmerge
at all. True, but parsing the original CUE to determine if binmerge
should be bypassed or not is a much more complex pipeline than simply chdman extractcd ... && binmerge --split ...
, so I believe this "no-op" feature is worth having
Downloaded the win64 file. Opened the executable. Just shows an empty command box and crashes in the span of half a second.
There are plans for an update the windows exe with the newest optimizations (relative paths os.path.basename) and new changes from you.
You can add the version string in the help informations.
on a MacBookPro9,2 running 10.15.7, i get this error running "--split" with a cdrdao ripped fighters megamix saturn ROM. log below:
mokman23@Catalina-MBP Downloads % ./binmerge --split fightersmegamix.cue fightersmegamix.bin [INFO] Output directory: /Users/mokman23/Downloads [INFO] Opening cue: /Users/mokman23/Downloads/fightersmegamix.cue Traceback (most recent call last): File "./binmerge", line 367, in <module> if not main(): File "./binmerge", line 332, in main cuesheet = gen_split_cuesheet(args.basename, cue_map[0]) IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.