Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Version 1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
john32b committed Mar 26, 2018
1 parent aa8d7af commit 1ff480a
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 62 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## CHANGELOG

### V1.2.4
- Progress Bar now reports total progress correctly and updates more frequently
- Progress Report on taskbar and window title
- Detailed CD report with individual track infos and checksums
- MP3 support *(In cases you want to convert to cue/mp3 for use in specific emulators, like KEGA Fusion)*
- Small usability tweaks
- If output folder exists, program puts a "_" at the end of the folder to avoid overwriting

### V1.2.3
- Added ability to select the compression level of the final archive from 1-9
- Function to convert a `.cue/.bin` to a .cue with encoded audio files. This can be really useful as some emulators support this .cue format.
- Re-added ogg vorbis support and now user can choose between (flac, opus, vorbis). This is for when creating cue/encoded audio, some emulators might only support ogg vorbis (*like mednafen*)

### V1.2.2
- Replaced the vorbis audio codec with the **opus** codec. It seems to be a better encoder and even supports lower bitrates (*like 32k*)

### V1.2.1
- Added **FLAC** support. Audio tracks can be encoded and then restored to an exact copy of their original source, to the last byte. Now the full CD can be preserved byte for byte.

### V1.2
- First **dotNet** release, continuing the project from the [NPM cdcrush 1.12](https://www.npmjs.com/package/cdcrush) release
- Calculate and display the **MD5** of the first data track, useful to quickly identify the validity of the CD
- Ability to add an image cover to a CD archive. The image will then be displayed when restoring a CD.
- MultiThreaded. Background FFmpeg and ECM operations can execute in parallel. *(Custom amount of threads in the options tab)*
- Temporary files will be deleted upon user program exit.
103 changes: 50 additions & 53 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@

# CDCRUSH dot NET

**Name**: CDCrush, *Highy compress cd-image games*\
**Name**: cdcrush, *Highy compress cd-image games*\
**Author:** John Dimi, <johndimi@outlook.com> *twitter*: [@jondmt](https://twitter.com/jondmt)\
**Project Page and Sources:** [https://github.com/johndimi/cdcrush.net](https://github.com/johndimi/cdcrush.net)\
**Language:** C# dotNET 4.5, VS2017 **Licence:** MIT\
**Version:** 1.2.3 **Platform:** Windows
**Language:** C# .NET 4.5, **Licence:** MIT\
**Version:** 1.2.4 **Platform:** Windows

## Download
To get the latest version check [the releases page here on github](https://github.com/johndimi/cdcrush.net/releases). Available for **windows** only.

To get the latest version check [the releases page here on github](https://github.com/johndimi/cdcrush.net/releases). \
Available for **windows** only.


## What is it

**Cdcrush** is a tool that can highly compress **CD based games** *( playstation 1, Pc-engine, etc )* for storage / sharing purposes.
![](https://i.imgur.com/wGMpNAP.png)

**How it is done:**
**cdcrush** is a tool that can highly compress **CD based games** *( playstation 1, Pc-engine, etc )* for storage / sharing purposes. **ALSO** it can encode the audio tracks of a CD and create a `.cue` file with *(mp3/ogg/flac)* tracks for use in emulators.

- The program separates the tracks of the cd image and compress them separately.
**⇒ How does it compress/crush a CD :**

- The program separates the tracks of a CD image and compress them separately.
- For **data** tracks it will use **ecm tools** to remove Error Correction/Detection Codes (ECC/EDC) data from the sectors. *( redundant data )*
- For **audio** tracks, it will use an encoder of your choice. You can select a lossy encoder like (**opus** or **vorbis**) to produce a decent quality audio file with a much smaller filesize compared to the uncompressed PCM audio original.
- **OR** you can choose to encode audio with **FLAC** which is lossless.
- Finally it compresses everything into a single archive using the **FreeArc** archiver.
- Finally it compresses everything into a single `.arc` archive using the **FreeArc** archiver.

**⇒ Restoring a crushed CD :**

**Then** it can **restore** the crushed CD image back to it's original form, a **.bin/.cue** image that is ready to be used however you like.
**cdcrush** can **restore** the crushed CD image back to it's original form, a **.bin/.cue** image that is ready to be used however you like.

**NOTE**: Archives with the audio tracks encoded with **FLAC**, will be restored to a 1:1 copy, byte for byte, of the original source CD

### Some example of game sizes archived with 7zip and cdcrush:
### Some examples of game sizes archived with 7zip and cdcrush:

| Title | Raw | 7z | cdcrush-ogg| cdcrush-flac |
| ----------------- | ------- | ------ | ----------- | -------|
Expand All @@ -41,52 +48,59 @@ To get the latest version check [the releases page here on github](https://githu
## USAGE


### General Infos
### General Info

- **cdcrush** is only compatible with `.cue/.bin` type CD images
- Supports dragging and dropping of files into the main window.
- **cdcrush** is only compatible with `.cue/.bin` type CD images. Some programs that allow you to rip your CDs to this format are:
- [cdrtfe](https://cdrtfe.sourceforge.io/cdrtfe/index_en.html), open source
- [ImgBurn](http://imgburn.com) ,free but not open source.
- When selecting an **output folder** you will be asked to save a dummy file, that file will not ever be written and the program will select the folder of that file.
- **[!]** The progress bar is a bit clunky, if it gets stuck just wait a bit. It's working.
- You can download the release without **FFmpeg** if you already have it, just be sure to set it up in the `settings` tab.
- :star2: **NEW since 1.2.4** : You can see the detailed info of a CD along with the tracks checksum. When restoring a CD, click the `Detailed Info` button. And for when crushing a CD, the button will become active AFTER the operation is complete.

### New Feature - Convert to .cue/encoded audio

You can now **convert** a `.cue/.bin` CD, into another `.cue/.bin` combo with **encoded audio tracks called from the cue file**\
This is really useful if you want to play a CD in an emulator that supports loading `.cue` files with encoded audio. (*e.g. mednafen supports libvorbis and FLAC audio*)
## :cd: Crushing a CD (*Compressing* )

To convert a CD, go to the **compress a cd** screen and **tick** the`convert to .CUE/encoded Audio` checkbox, then hit the button. The new files are going to be generated under a subfolder to avoid overwriting the source .cue/.bin files

### Crushing (*Compressing* )

![](https://i.imgur.com/45mv53u.png)
![Crushing a CD screen](https://i.imgur.com/FIKj4eG.png)
- Select an input file ( **.cue** ). You can drop it in the window or click the **[...]** button to select one
- Optionally set an output folder, the final **.arc** file will be created there, auto-named after the CD title
- Optionally set a cover image by dropping a **.png** file in the window, or by clicking on the image placeholder
- Optionally set a cover image by dropping a **.jpg** file in the window, or by clicking on the image placeholder
- Choose an **audio codec** and **bitrate** to encode the audio tracks with (*if any*)
- You can choose a compression level. The default is **4** and it's very solid. You can try experimenting, but **WARNING** don't go above **6** since you'll need HUGE amounts of RAM to encode and decode (*also it will take forever*)
- You can choose a compression level. The default is **4** and it's very solid. You can try experimenting, but **WARNING** :warning: don't go above **6** since you'll need HUGE amounts of RAM to encode and decode (*also it will take forever*)
- You can optionally change the CD Title, in case the automatic name is wrong
- **Leave** the `Convert to .Cue/Encoded audio` checkbox **UNTICKED**
- Press the **CRUSH** button
- Wait for the operation to end

### Restoring
## :arrows_clockwise: Restoring a CD

![](https://i.imgur.com/KtDuMuw.png)
![Restoring a CD screen](https://i.imgur.com/tmQncxk.png)

- Select a previously crushed archive ( **.arc** ) to be restored. You can drop it in the window or click the **[...]** button to select one
- Optionally set an output folder, the (**.cue/.bin**) files will be created there, auto-named after the CD title
- Check the `Create subfolder` checkbox to create a subfolder named after the CD title and put the cd image there
- Check the `Create subfolder` checkbox to create a subfolder named after the CD title and put the restored CD image there
- Check the `Single bin/cue` to **force** restoring the CD back into a single bin file, even if the original source was a multi file bin/cue image
- **NEW** you can check the `Restore to .cue/Encoded audio` to restore the CD and leave the Audio Tracks encoded. Can be used with some emulators that support `.cue` files with encoded audio tracks.
- Press the **RESTORE** button
- Wait for the operation to end

### Settings
## :cd: Converting to .cue/encoded audio

You can **convert** a `.cue/.bin` CD, into another `.cue/.bin` combo with **encoded audio tracks called from the cue file**. This is really useful if you want to play a CD in an emulator that supports loading `.cue` files with encoded audio tracks (*e.g. mednafen supports libvorbis and FLAC audio*)

To convert a CD, go to the **Compress a CD** screen and **tick** the`convert to .CUE/encoded Audio` checkbox, select the audio quality and click **CONVERT**. The new files are going to be generated under a subfolder to avoid overwriting the source .cue/.bin files.

![](https://i.imgur.com/sP8VdMU.png)
<sup>Example of what this operation does.</sup>

> **NOTE**: This can also be achieved when restoring a CD be ticking the `restore to .cue/encoded audio`
## :wrench: Settings tab

![](https://i.imgur.com/mtlI5DR.png)

**Temp Folder** :
You can set a custom temporary folder for the various background processes like FFmpeg. Useful if you have a RAMDRIVE. \
**NOTE** : Make sure the temp folder can hold up to 1.2GB of data !
:warning: **WARNING** : Make sure the temp folder can hold up to 1.2GB of data !

**FFmpeg Path** :
Point to the location of `ffmpeg.exe` , it is needed for encoding/decoding the audio tracks. If you have `FFmpeg` set on the system/user PATH, it will be checked once you **clear** the custom path.
Expand All @@ -95,47 +109,30 @@ Point to the location of `ffmpeg.exe` , it is needed for encoding/decoding the a
How many tracks to process at the same time. *(For when compressing or restoring with ffmpeg and ecm tools)*


## CHANGELOG

### V1.2.3
- Added ability to select the compression level of the final archive from 1-9
- Function to convert a `.cue/.bin` to a .cue with encoded audio files. This can be really useful as some emulators support this .cue format.
- Re-added ogg vorbis support and now user can choose between (flac, opus, vorbis). This is for when creating cue/encoded audio, some emulators might only support ogg vorbis (*like mednafen*)

### V1.2.2
- Replaced the vorbis audio codec with the **opus** codec. It seems to be a better encoder and even supports lower bitrates (*like 32k*)

### V1.2.1
- Added **FLAC** support. Audio tracks can be encoded and then restored to an exact copy of their original source, to the last byte. Now the full CD can be preserved byte for byte.

### V1.2
- First **dotNet** release, continuing the project from the [NPM cdcrush 1.12](https://www.npmjs.com/package/cdcrush) release
- Calculate and display the **MD5** of the first data track, useful to quickly identify the validity of the CD
- Ability to add an image cover to a CD archive. The image will then be displayed when restoring a CD.
- MultiThreaded. Background FFmpeg and ECM operations can execute in parallel. *(Custom amount of threads in the options tab)*
- Temporary files will be deleted upon user program exit.
## :exclamation: CHANGELOG
See [`CHANGELOG.MD`](CHANGELOG.MD)

## Q&A
## :clipboard: Q&A

**Q** : Why?\
**A** : I wanted to save space on my hard drive and I think it's a decent way to store cd images, better than just compressing with 7zip or Rar. Also It was a good programming practice.
**A** : I wanted to save space on my hard drive and I think it's a decent way to store CD images, better than just compressing with 7zip or Rar. Also It was a good programming practice.

**Q** : Does it support games from SegaCD, Jaguar, 3DO, X, Y?\
**A** : Theoretically it should support all valid **.cue/.bin** files, try it out.

**Q** : I am worried about the audio quality.\
**A** : The OGG ~~vorbis~~ (new **OPUS**) codec is decent and it can produce very good results even at 96kbps. ~~Also, implementing a **FLAC** codec is coming at a later version.~~ *flac is ready to go*
**A** : The OGG vorbis (also new **OPUS**) codec is decent and it can produce very good results even at 96kbps. **However** if you don't want any compressed audio you can select the **FLAC** encoder, which is lossless.

**Q**: Is storing the entire CD with FLAC really lossless? I am worried about byte integrity.\
**A**: YES, to the last byte. The filesize and checksums of the restored tracks are the same as the original ones. (data&audio). You can check for yourself by calculating the checksums of restored files vs original source. **ALSO Checksum reports** are coming at a later version.
**A**: YES, to the last byte. The filesize and checksums of the restored tracks are the same as the original ones. (data&audio). You can check for yourself by calculating the checksums of restored files vs original source. **ALSO Checksum reports** ~~are coming at a later version~~ implemented since v.1.2.4

**Q** : Why there are two versions of the program?\
**A** : FFmpeg.exe is a small beast ( *around 36 megabytes*) and in some cases users already have it on their pc. So I am publishing a version with and a version without it.


## Npm Version

This project is a continuation of [**cdcrush npm**](https://www.npmjs.com/package/cdcrush). You can check it out if you want, but **note** that the NPM version is old and **NOT RECOMMENDED TO USE** until I update it.
This project is a continuation of [**cdcrush npm**](https://www.npmjs.com/package/cdcrush). You can check it out if you want, but **note** :warning: that the NPM version is old and **NOT RECOMMENDED TO USE** until I update it.

## About

Expand Down
2 changes: 1 addition & 1 deletion cdcrush/forms/FormChecksums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected override void OnLoad(EventArgs e)
Text = "CD Info - " + cd.CD_TITLE;
textbox.Text = prog.CDCRUSH.PROGRAM_NAME + " v" + prog.CDCRUSH.PROGRAM_VERSION;
textbox.Text+= " - Detailed CD Info" + Environment.NewLine;
textbox.Text+= "-------------------" + Environment.NewLine;
textbox.Text+= "---------------------------------" + Environment.NewLine;
textbox.Text+= cd.getDetailedInfo();
}// -----------------------------------------

Expand Down
1 change: 1 addition & 0 deletions cdcrush/forms/PanelCompress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ void form_quickLoadFile(string file)
form_lockSection("action", false);
form_set_info_pre(o);
numberOfTracks = o.tracks;
FormMain.sendMessage("Loaded CUE OK.", 2);
}

}// -----------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions cdcrush/prog/CDCRUSH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public static class CDCRUSH
public const string CDCRUSH_COVER = "cover.jpg";
public const string CDCRUSH_EXTENSION = ".arc";


public const string RESTORED_CUE_FOLDER_SUFFIX = " (r)";
// When restoring a cd to a folder, put this at the end of the folder's name
public const string RESTORED_FOLDER_SUFFIX = " (r)";

// -- Global

Expand Down
7 changes: 5 additions & 2 deletions cdcrush/prog/JobConvertCue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public JobConvertCue(CrushParams p):base("Convert CD")

// : NEW :
// : ALWAYS Create a subfolder to avoid overwriting the source files
p.outputDir = CDCRUSH.checkCreateUniqueOutput(p.outputDir, p.cdTitle + CDCRUSH.RESTORED_CUE_FOLDER_SUFFIX);
p.outputDir = CDCRUSH.checkCreateUniqueOutput(p.outputDir, p.cdTitle + CDCRUSH.RESTORED_FOLDER_SUFFIX);
if(p.outputDir==null) {
fail("Output Dir Error " + p.outputDir);
return;
Expand Down Expand Up @@ -136,9 +136,12 @@ public JobConvertCue(CrushParams p):base("Convert CD")
}
else
{
// Audio tracks are already there, moving won't do anything.
// TaskCompress already put the audio files on the output folder
// But it's no big deal calling it again
// This is for the data tracks that are on the temp folder
FileTools.tryMove(track.workingFile, Path.Combine(p.outputDir, track.trackFile));
}
t.PROGRESS += stepProgress;
}
Expand Down
2 changes: 1 addition & 1 deletion cdcrush/prog/JobCrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public struct CrushParams
internal string finalArcPath;
// If true, then all the track files are stored in temp folder and safe to delete
internal bool flag_sourceTracksOnTemp;
// True on `jobconvert`
// USED in `JobConvertCue`
internal bool flag_convert_only;

}// --
Expand Down
7 changes: 4 additions & 3 deletions cdcrush/prog/TaskCompressTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public override void start()
{
case 0: // FLAC
setupFiles(".flac");
ffmp.audioPCMToFlac(sourceTrackFile,track.workingFile);
ffmp.audioPCMToFlac(sourceTrackFile, track.workingFile);
break;

case 1: // VORBIS
Expand All @@ -107,12 +107,13 @@ public override void start()

case 2: // OPUS
setupFiles(".ogg");
// Opus needs an actual bitrate, not an index
ffmp.audioPCMToOggOpus(sourceTrackFile, FFmpeg.OPUS_QUALITY[audioQ.Item2], track.workingFile);
break;

case 3: // MP3
setupFiles(".mp3");
ffmp.audioPCMToMP3(sourceTrackFile,audioQ.Item2,track.workingFile);
ffmp.audioPCMToMP3(sourceTrackFile, audioQ.Item2, track.workingFile);
break;

}//- end switch
Expand Down Expand Up @@ -140,7 +141,7 @@ void setupFiles(string ext)
// --
void handleProgress(int p)
{
PROGRESS = p;
PROGRESS = p; // uses setter
}// -----------------------------------------

// --
Expand Down

0 comments on commit 1ff480a

Please sign in to comment.