the bluray I was testing with was the original total recall.
Code: Select all
byte tsunit[TSUNIT_LENGTH];
const char * mmbdVersion = mmbd_get_version_string();
printf("Libmmd.dll version %s\r\n", mmbdVersion);
MMBD * mmbdContext = mmbd_create_context(NULL, OutputProc, NULL);
if(mmbdContext != NULL)
{
const char* deviceid = "F:";
const char* m2tsFile = "00002.m2ts";
char path[MAX_PATH];
sprintf(path, "%s\\BDMV\\STREAM\\%s", deviceid, m2tsFile);
printf("Opening Drive %s\r\n", deviceid);
int retval = mmbd_open(mmbdContext, deviceid);
if(retval == 0)
{
printf("MKV: %d\r\n", mmbd_get_mkb_version(mmbdContext));
const char * outputPath = "C:\\dev\\data\\test.m2ts";
printf("Copying %s to %s\r\n", path, outputPath);
::DeleteFile(outputPath);
FILE * input = fopen(path, "rb");
FILE * output = fopen(outputPath, "wb");
uint64_t fileOffset = 0;
while (fread(tsunit, TSUNIT_LENGTH, 1, input) == 1)
{
retval = mmbd_decrypt_unit(mmbdContext, MMBD_FILE_M2TS, fileOffset, tsunit);
if (retval != 0)
{
printf("Decrypt Failed.\r\n");
}
fileOffset += TSUNIT_LENGTH;
fwrite(tsunit, TSUNIT_LENGTH, 1, output);
}
fclose(input);
fclose(output);
printf("Closing Drive %s\r\n", deviceid);
mmbd_close(mmbdContext);
}
mmbd_destroy_context(mmbdContext);
}
Code: Select all
Libmmd.dll version libmmbd v1.1.0
MakeMKV v1.8.6 win(x64-release) started
Debug logging enabled, log will be saved as C:\Users\vash\AppData\Local\Temp/MakeMKV-8708-1.tmp
Opening Drive F:
Using direct disc access mode
Operation successfully completed
MKV: 3
Copying F:\BDMV\STREAM\00002.m2ts to C:\dev\data\test.m2ts
Closing Drive F:
Code: Select all
Debug log started at Mon Nov 11 20:22:30 2013 , written by MakeMKV v1.8.6 win(x64-release)
Using 524544KB for read cache.
001005:0000 MakeMKV v1.8.6 win(x64-release) started
001004:0000 Debug logging enabled, log will be saved as C:\Users\vash\AppData\Local\Temp/MakeMKV-10140-1.tmp
003007:0000 Using direct disc access mode
DAFD=PAAAADAAAAEABDQEEAQEBAQ==
DCE=PTd3BDhngQ7K3J26NZ8WKgi0m4p6g3IxzJTLuNgNl67Y8SCiCxCwlTBoFNAhYjMVNka3zk5D72DNbAULwzsaQDjb9MdLeky3uKAIWJ3k9da5jyV1WcjibMS4G3IGDa56IYnfpX5YgLpLWXh6ep6yRcRHe2TSoYIs2Q==
DISCID=6F4D5B3F496187C4CBE7CB6E6A0B526BF7D76FB2
005011:0000 Operation successfully completed
-vash