diff --git a/History_CLI.txt b/History_CLI.txt index 4dd57d4e..391e0e21 100644 --- a/History_CLI.txt +++ b/History_CLI.txt @@ -1,3 +1,12 @@ +Version 24.11, 2024-11-11 +------------- +Cleanup of the output +Add --log-name option for summary in a file at the end of the processing +Support of DPX Y 10-bit from DIAMANT-Film +Accept null bytes in DPX version +Add TIFF 8-bit LE +Fix wrong compute of max slice count with DPX having group of pixels + Version 23.12, 2023-12-18 ------------- Support of DPX/Y/12-bit/Packed/BE diff --git a/Project/Chocolatey/rawcooked.nuspec b/Project/Chocolatey/rawcooked.nuspec index 68c79cf9..c8901beb 100644 --- a/Project/Chocolatey/rawcooked.nuspec +++ b/Project/Chocolatey/rawcooked.nuspec @@ -4,7 +4,7 @@ rawcooked RAWcooked - 23.12 + 24.11 https://github.com/MediaArea/RAWcooked/blob/master/Project/Chocolatey MediaArea.net MediaArea.net diff --git a/Project/Chocolatey/tools/chocolateyinstall.ps1 b/Project/Chocolatey/tools/chocolateyinstall.ps1 index 3a551baf..0c4ae06a 100644 --- a/Project/Chocolatey/tools/chocolateyinstall.ps1 +++ b/Project/Chocolatey/tools/chocolateyinstall.ps1 @@ -2,7 +2,7 @@ $packageArgs = @{ PackageName = "${env:ChocolateyPackageName}" - Url64bit = "https://mediaarea.net/download/binary/rawcooked/23.12/RAWcooked_CLI_23.12_Windows_x64.zip" + Url64bit = "https://mediaarea.net/download/binary/rawcooked/24.11/RAWcooked_CLI_24.11_Windows_x64.zip" Checksum64 = '0000000000000000000000000000000000000000000000000000000000000000' ChecksumType64 = 'sha256' UnzipLocation = "$(split-path -parent $MyInvocation.MyCommand.Definition)\rawcooked" diff --git a/Project/GNU/CLI/test/test1.txt b/Project/GNU/CLI/test/test1.txt index 5f01364f..2993471a 100644 --- a/Project/GNU/CLI/test/test1.txt +++ b/Project/GNU/CLI/test/test1.txt @@ -210,8 +210,10 @@ Formats/DPX/Flavors/Y_10_FilledB_BE/Y_10_FilledB_BE_Modified_9x4_Scanity.dpx Formats/DPX/Flavors/Y_12_Packed_BE/086400.dpx pass Formats/DPX/Flavors/Y_16_FilledA_BE/0000001.dpx pass Formats/DPX/Flavors/Y_16_Packed_BE/FFmpeg_gray16be.dpx pass +Formats/DPX/Flavors/Y_16_Packed_BE/pack3.dpx pass Formats/DPX/Flavors/Y_16_Packed_LE/FFmpeg_gray16le.dpx pass Formats/DPX/Conformance/0004_OffsetToImageData/0004_OffsetToImageData_000000.dpx fail +Formats/DPX/Conformance/0008_VersionNumber/0008_VersionNumber_null.dpx pass Formats/DPX/Conformance/0008_VersionNumber/0008_VersionNumber_v.dpx pass Formats/EXR/Features/Compressed/PXR24/AllHalfValues.exr fail Formats/EXR/Flavors/RGB_16F/Color_Test_Chart_LogC_400ASA_3200k.cpu.00.exr pass @@ -252,6 +254,7 @@ Formats/TIFF/Flavors/Raw_Y_2_U/flower-minisblack-02.tif fail Formats/TIFF/Flavors/Raw_Y_4_U/flower-minisblack-04.tif fail Formats/TIFF/Flavors/Raw_Y_6_U/flower-minisblack-06.tif fail Formats/TIFF/Flavors/Raw_Y_8_U/flower-minisblack-08.tif pass +Formats/TIFF/Flavors/Raw_Y_8_U/Raw_Y_8_U_LE.tif pass Formats/TIFF/Flavors/Raw_Y_10_U/flower-minisblack-10.tif fail Formats/TIFF/Flavors/Raw_Y_12_U/flower-minisblack-12.tif fail Formats/TIFF/Flavors/Raw_Y_14_U/flower-minisblack-14.tif fail diff --git a/Project/GNU/PKGBUILD b/Project/GNU/PKGBUILD index ce5aa6c2..cac02736 100644 --- a/Project/GNU/PKGBUILD +++ b/Project/GNU/PKGBUILD @@ -2,7 +2,7 @@ # Maintainer: MediaArea.net SARL pkgname=('rawcooked') -pkgver=23.12 +pkgver=24.11 pkgrel=1 pkgdesc="Encodes RAW audio-visual data while permitting reversibility" url="http://mediaarea.net" diff --git a/Project/GNU/rawcooked.dsc b/Project/GNU/rawcooked.dsc index 9658bd96..2a8affaa 100644 --- a/Project/GNU/rawcooked.dsc +++ b/Project/GNU/rawcooked.dsc @@ -2,11 +2,11 @@ Format: 3.0 (quilt) Source: rawcooked Binary: rawcooked, rawcooked-dbg Architecture: any -Version: 23.12-1 +Version: 24.11-1 Maintainer: Jerome Martinez Homepage: https://mediaarea.net Standards-Version: 3.7.3 Build-Depends: debhelper (>=7), pkg-config, automake, autoconf, libtool Files: - 00000000000000000000000000000000 000000 rawcooked_23.12.orig.tar.xz - 00000000000000000000000000000000 000000 rawcooked_23.12-1.debian.tar.xz + 00000000000000000000000000000000 000000 rawcooked_24.11.orig.tar.xz + 00000000000000000000000000000000 000000 rawcooked_24.11-1.debian.tar.xz diff --git a/Project/GNU/rawcooked.spec b/Project/GNU/rawcooked.spec index 189dd234..a1a635e4 100644 --- a/Project/GNU/rawcooked.spec +++ b/Project/GNU/rawcooked.spec @@ -4,7 +4,7 @@ # norootforbuild -%global rawcooked_version 23.12 +%global rawcooked_version 24.11 Name: rawcooked Version: %rawcooked_version @@ -72,5 +72,5 @@ popd %{_mandir}/man1/rawcooked.* %changelog -* Mon Jan 01 2018 Jerome Martinez - 23.12-0 +* Mon Jan 01 2018 Jerome Martinez - 24.11-0 - See History.txt for more info and real dates diff --git a/Project/MSVC2017/CLI/RAWcooked.rc b/Project/MSVC2017/CLI/RAWcooked.rc index 5b0817ec..1d23f652 100644 --- a/Project/MSVC2017/CLI/RAWcooked.rc +++ b/Project/MSVC2017/CLI/RAWcooked.rc @@ -1,8 +1,8 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 23,12,0,0 - PRODUCTVERSION 23,12,0,0 + FILEVERSION 24,11,0,0 + PRODUCTVERSION 24,11,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -19,12 +19,12 @@ BEGIN BEGIN VALUE "CompanyName", "MediaArea.net" VALUE "FileDescription", "RAWcooked" - VALUE "FileVersion", "23.12.0.0" + VALUE "FileVersion", "24.11.0.0" VALUE "InternalName", "RAWcooked - CLI" VALUE "LegalCopyright", "MediaArea.net" VALUE "OriginalFilename", "RAWcooked.exe" VALUE "ProductName", "RAWcooked" - VALUE "ProductVersion", "23.12.0.0" + VALUE "ProductVersion", "24.11.0.0" END END BLOCK "VarFileInfo" diff --git a/Project/MSVC2019/CLI/RAWcooked.rc b/Project/MSVC2019/CLI/RAWcooked.rc index 3c971ac7..fb34cb07 100644 --- a/Project/MSVC2019/CLI/RAWcooked.rc +++ b/Project/MSVC2019/CLI/RAWcooked.rc @@ -1,8 +1,8 @@ #include VS_VERSION_INFO VERSIONINFO - FILEVERSION 23,12,0,0 - PRODUCTVERSION 23,12,0,0 + FILEVERSION 24,11,0,0 + PRODUCTVERSION 24,11,0,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -19,12 +19,12 @@ BEGIN BEGIN VALUE "CompanyName", "MediaArea.net" VALUE "FileDescription", "RAWcooked" - VALUE "FileVersion", "23.12.0.0" + VALUE "FileVersion", "24.11.0.0" VALUE "InternalName", "RAWcooked - CLI" VALUE "LegalCopyright", "MediaArea.net" VALUE "OriginalFilename", "RAWcooked.exe" VALUE "ProductName", "RAWcooked" - VALUE "ProductVersion", "23.12.0.0" + VALUE "ProductVersion", "24.11.0.0" END END BLOCK "VarFileInfo" diff --git a/Project/Mac/Info.plist b/Project/Mac/Info.plist index fdd49eb2..226db776 100644 --- a/Project/Mac/Info.plist +++ b/Project/Mac/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 23.12 + 24.11 CFBundleVersion - 23.12 + 24.11 DTSDKName macosx10.6 LSApplicationCategoryType diff --git a/Project/version.txt b/Project/version.txt index dbc391ff..f88da62e 100644 --- a/Project/version.txt +++ b/Project/version.txt @@ -1 +1 @@ -23.12 +24.11 diff --git a/Source/CLI/Global.cpp b/Source/CLI/Global.cpp index c53cea70..6db73062 100644 --- a/Source/CLI/Global.cpp +++ b/Source/CLI/Global.cpp @@ -242,6 +242,13 @@ int global::SetHash(bool Value) return 0; } +//--------------------------------------------------------------------------- +int global::SetLogFileName(const char* FileName) +{ + LogFileName = FileName; + return 0; +} + //--------------------------------------------------------------------------- int global::SetAll(bool Value) { @@ -314,6 +321,18 @@ int global::SetOption(const char* argv[], int& i, int argc) License.Encoder(encoder::FFV1); return 0; } + if (!strncmp(argv[i], "ffv1_vulkan", 11) && (!argv[i][11] || (argv[i][11] == ':' && argv[i][12] >= '0' && argv[i][12] <= '9' && !argv[i][13]))) + { + OutputOptions["c:v"] = "ffv1_vulkan"; + if (argv[i][11]) + OutputOptions["init_hw_device"] = "\"vulkan=vk" + string(argv[i] + 11) + '\"'; + else + OutputOptions["init_hw_device"] = "\"vulkan=vk:0\""; + OutputOptions["vf"] = "hwupload"; + License.Encoder(encoder::FFV1); + License.Feature(feature::HwAccel); + return 0; + } return Error_NotTested(argv[i - 1], argv[i]); } if (!strcmp(argv[i], "-coder")) @@ -582,6 +601,16 @@ int global::ManageCommandLine(const char* argv[], int argc) if (Value) return Value; } + else if (strcmp(argv[i], "--log-name") == 0) + { + LogFile_IgnorePos.insert(i); + if (i + 1 == argc) + return Error_Missing(argv[i]); + int Value = SetLogFileName(argv[++i]); + LogFile_IgnorePos.insert(i); + if (Value) + return Value; + } else if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { int Value = Help(argv[0]); @@ -780,6 +809,7 @@ int global::ManageCommandLine(const char* argv[], int argc) OutputOptions["n"] = string(); OutputOptions.erase("y"); Mode = AlwaysNo; // Also RAWcooked itself + LogFile_IgnorePos.insert(i); } else if (!strcmp(argv[i], "-threads")) { @@ -793,6 +823,7 @@ int global::ManageCommandLine(const char* argv[], int argc) OutputOptions["y"] = string(); OutputOptions.erase("n"); Mode = AlwaysYes; // Also RAWcooked itself + LogFile_IgnorePos.insert(i); } else if (OptionsForOtherFiles) { @@ -815,9 +846,15 @@ int global::ManageCommandLine(const char* argv[], int argc) return Value; } else + { Inputs.push_back(argv[i]); + LogFile_IgnorePos.insert(i); + } } + if (BinName.empty()) + BinName = "ffmpeg"; + // License if (License.LoadLicense(LicenseKey, StoreLicenseKey)) return true; @@ -834,6 +871,8 @@ int global::ManageCommandLine(const char* argv[], int argc) if (Inputs.empty() && (ShowLicenseKey || SubLicenseId)) return 0; + if (!LogFileName.empty()) + Log = new string; return 0; } diff --git a/Source/CLI/Global.h b/Source/CLI/Global.h index e06e1f18..71e661c2 100644 --- a/Source/CLI/Global.h +++ b/Source/CLI/Global.h @@ -15,6 +15,7 @@ #include "Lib/Uncompressed/HashSum/HashSum.h" #include "Lib/License/License.h" #include +#include #include #include #include @@ -34,6 +35,7 @@ class global string rawcooked_reversibility_FileName; string OutputFileName; string FrameMd5FileName; + string LogFileName; string BinName; string LicenseKey; uint64_t SubLicenseId; @@ -52,11 +54,13 @@ class global // Intermediate info size_t Path_Pos_Global; vector Inputs; + set LogFile_IgnorePos; license License; user_mode Mode = Ask; hashes Hashes; errors Errors; ask_callback Ask_Callback = nullptr; + string* Log = nullptr; // Conformance check intermediary info vector Durations; @@ -100,6 +104,7 @@ class global int SetFrameMd5An(bool Value); int SetFrameMd5FileName(const char* FileName); int SetHash(bool Value); + int SetLogFileName(const char* FileName); int SetAll(bool Value); private: diff --git a/Source/CLI/Help.cpp b/Source/CLI/Help.cpp index 0d32ebaf..61aa2d7d 100644 --- a/Source/CLI/Help.cpp +++ b/Source/CLI/Help.cpp @@ -138,6 +138,10 @@ ReturnValue Help(const char* Name) " -n Automatic no to prompts.\n" " Assume no as answer to all prompts, and run non-interactively.\n" "\n" + " --log-name value\n" + " Set the name of the RAWcooked log file written after\n" + " successful processing.\n" + "\n" " ACTIONS\n" " --all Same as --info --conch --decode --encode --hash --coherency\n" " --check-padding --check --accept-gaps (see below)\n" @@ -385,3 +389,15 @@ ReturnValue Version() return ReturnValue_OK; } + +//--------------------------------------------------------------------------- +const char* GetLibraryName() +{ + return LibraryName; +} + +//--------------------------------------------------------------------------- +const char* GetLibraryVersion() +{ + return LibraryVersion; +} diff --git a/Source/CLI/Help.h b/Source/CLI/Help.h index c81656bb..aa8a94ca 100644 --- a/Source/CLI/Help.h +++ b/Source/CLI/Help.h @@ -17,5 +17,7 @@ ReturnValue Help(const char* Name); ReturnValue Usage(const char* Name); ReturnValue Version(); +const char* GetLibraryVersion(); +const char* GetLibraryName(); #endif diff --git a/Source/CLI/Main.cpp b/Source/CLI/Main.cpp index 53efb45e..f63b82fd 100644 --- a/Source/CLI/Main.cpp +++ b/Source/CLI/Main.cpp @@ -8,6 +8,7 @@ #include "CLI/Global.h" #include "CLI/Input.h" #include "CLI/Output.h" +#include "CLI/Help.h" #include "Lib/Compressed/Matroska/Matroska.h" #include "Lib/Uncompressed/DPX/DPX.h" #include "Lib/Uncompressed/TIFF/TIFF.h" @@ -27,6 +28,11 @@ #include #include #include +#if defined(_WIN32) || defined(_WINDOWS) +#define popen _popen +#define pclose _pclose +#else +#endif using namespace std; //--------------------------------------------------------------------------- @@ -531,31 +537,46 @@ int ParseFile_Compressed(parse_info& ParseInfo) if (!HasCheckedReversibility && M->Hashes_FromRAWcooked) HasCheckedReversibility = true; - if (Global.Actions[Action_Info]) + if (Global.Actions[Action_Info] || Global.Log) { + string Info; if (!M->RAWcooked_LibraryNameVersion_Get().empty()) { - cout << "\nInfo: Reversibility data created by " << M->RAWcooked_LibraryNameVersion_Get() << '.'; + Info += "\nInfo: Reversibility data created by "; + Info += M->RAWcooked_LibraryNameVersion_Get(); + Info += '.'; } - else if (!Global.Actions[Action_Decode]) + else if (Global.Actions[Action_Decode]) { - cout << "\nInfo: No reversibility data found."; + Info += "\nInfo: No reversibility data found."; } if (M->Hashes_FromRAWcooked) { - cout << "\nInfo: Uncompressed file hashes (used by reversibility check) present."; + Info += "\nInfo: Uncompressed file hashes (used by reversibility check) present."; } if (M->Hashes_FromAttachments && M->Hashes_FromAttachments->HashFiles_Count()) { - cout << "\nInfo: " << M->Hashes_FromAttachments->HashFiles_Count() << " hash file (used by conformance check) found."; + Info += "\nInfo: "; + Info += to_string(M->Hashes_FromAttachments->HashFiles_Count()); + Info += " hash file"; + if (M->Hashes_FromAttachments->HashFiles_Count() > 1) + Info += 's'; + Info += " (used by conformance check) found."; } cout << endl; + if (Global.Actions[Action_Info]) + cout << Info; + if (Global.Log) + *Global.Log += Info; } if (Global.Actions[Action_Decode] || Global.Actions[Action_Check]) { if (M->RAWcooked_LibraryNameVersion_Get().empty()) { - cerr << "\nError: No reversibility data found."; + auto Info = "\nError: No reversibility data found."; + cerr << Info; + if (Global.Log) + *Global.Log += Info; ReturnValue = 1; DoesNotHaveReversibility = true; } @@ -566,15 +587,33 @@ int ParseFile_Compressed(parse_info& ParseInfo) } // End + string Info; if (ParseInfo.IsDetected && !Global.Quiet && !DoesNotHaveReversibility) { if (Global.Actions[Action_Decode]) - cout << "\nFiles are in " << OutputDirectoryName << '.' << endl; + { + cout << "\nInfo: Files are in "; + cout << OutputDirectoryName; + cout << "."; + } if (Global.Actions[Action_Check] && !Global.Errors.HasErrors()) - cout << '\n' << (HasCheckedReversibility ? "Reversibility" : "Decoding") << " was checked, no issue detected." << endl; + { + Info += "\nInfo: "; + Info += (HasCheckedReversibility ? "Reversibility" : "Decoding"); + Info += " was checked, no issue detected."; + } } if (Global.Actions[Action_Check] && Global.Errors.HasErrors()) - cout << '\n' << (HasCheckedReversibility ? "Reversibility" : "Decoding") << " was checked, issues detected, see below." << endl; + { + Info += "\nInfo: "; + Info += (HasCheckedReversibility ? "Reversibility" : "Decoding"); + Info += " was checked, issues detected, see below."; + } + if (!Info.empty() && Info.back() != '\n') + Info += '\n'; + cout << Info; + if (Global.Log) + *Global.Log += Info; return ReturnValue; } @@ -671,24 +710,167 @@ int main(int argc, const char* argv[]) // Info if (!Global.Quiet) { + string PrefixContent; + auto ComputePrefix = [&](const string& FileName) + { + if (PrefixContent.size() > FileName.size()) + PrefixContent.resize(FileName.size()); + for (size_t j = 0; j < PrefixContent.size(); j++) + if (PrefixContent[j] != FileName[j]) + { + PrefixContent.resize(j); + break; + } + }; for (size_t i = 0; i < Output.Streams.size(); i++) { - cerr << "Track " << i + 1 << ':' << endl; - if (Output.Streams[i].FileName_Template.empty()) + auto IsTemplate = !Output.Streams[i].FileName_Template.empty(); + const string& FileName = IsTemplate ? Output.Streams[i].FileName_Template : Output.Streams[i].FileName; + if (!i) { - cerr << " " << Output.Streams[i].FileName.substr(((Global.Inputs.size() == 1 && Global.Inputs[0].size() < Output.Streams[i].FileName.size()) ? Global.Inputs[0].size() : Output.Streams[i].FileName.find_last_of("/\\")) + 1) << endl; + PrefixContent = FileName; + continue; } - else + ComputePrefix(FileName); + } + for (const auto& Attachment : Output.Attachments) + { + ComputePrefix(Attachment.FileName_In); + } + auto PrefixSize = PrefixContent.size(); + + if (Global.Log) + { + *Global.Log += GetLibraryName(); + *Global.Log += ' '; + *Global.Log += GetLibraryVersion(); + if (Global.Actions[Action_Encode]) + { + FILE* FFmpeg_Version_F = popen((Global.BinName + " -version").c_str(), "r"); + if (FFmpeg_Version_F) + { + char Result[256] = { }; + if (fgets(Result, sizeof(Result), FFmpeg_Version_F)) + { + auto Result2 = strchr(Result, ' '); + if (Result2) + { + Result2++; + if (!strncmp(Result2, "version ", 8)) + Result2 += 8; + auto Result3 = strchr(Result2, ' '); + if (!Result3) + auto Result3 = strchr(Result2, '\0'); + if (Result3) + { + *Global.Log += ", FFmpeg "; + Global.Log->append(Result2, Result3 - Result2); + } + + } + } + pclose(FFmpeg_Version_F); + } + } + *Global.Log += "\nParameters used:"; + for (int i = 1; i < argc; i++) + { + if (Global.LogFile_IgnorePos.find(i) != Global.LogFile_IgnorePos.end()) + continue; + if (!strcmp(argv[i], "-b") || !strcmp(argv[i], "--bin-name")) + { + i++; + continue; + } + *Global.Log += ' '; + *Global.Log += argv[i]; + } + *Global.Log += '\n'; + + string PackageName; + if (PrefixSize) + { + if (PrefixContent.find_first_of("\\/", PrefixContent.size() - 1) != string::npos) + PrefixContent.pop_back(); + PackageName = PrefixContent; + if (!PackageName.empty()) + { + auto Pos = PackageName.find_last_of("\\/"); + if (Pos != string::npos) + PackageName.erase(0, Pos + 1); + } + } + *Global.Log += '\n'; + if (!PackageName.empty()) + { + *Global.Log += "Package name: "; + *Global.Log += PackageName; + *Global.Log += '\n'; + } + } + + string Message; + const char* FlavorNotSupported = "\n *** This input format flavor is not supported by the current license key. ***"; + for (size_t i = 0; i < Output.Streams.size(); i++) + { + if (i) + Message += '\n'; + Message += "Track "; + Message += to_string(i + 1); + Message += ":\n "; + auto IsTemplate = !Output.Streams[i].FileName_Template.empty(); + const string& FileName = IsTemplate ? Output.Streams[i].FileName_Template : Output.Streams[i].FileName; + #if defined(_WIN32) || defined(_WINDOWS) + auto FileName2 = FileName.substr(PrefixSize); + auto Pos = 0; + for (;;) + { + Pos = FileName2.find('\\'); + if (Pos == string::npos) + break; + FileName2[Pos] = '/'; + Pos++; + } + Message += FileName2; + #else + Message += FileName.substr(PrefixSize); + #endif + if (IsTemplate) { - cerr << " " << Output.Streams[i].FileName_Template.substr(((Global.Inputs.size() == 1 && Global.Inputs[0].size() < Output.Streams[i].FileName.size()) ? Global.Inputs[0].size() : Output.Streams[i].FileName.find_last_of("/\\")) + 1) << endl; - cerr << " (" << Output.Streams[i].FileName_StartNumber << " --> " << Output.Streams[i].FileName_EndNumber; + Message += "\n ("; + Message += Output.Streams[i].FileName_StartNumber; + Message += " --> "; + Message += Output.Streams[i].FileName_EndNumber; if (!Output.Streams[i].FileList.empty()) - cerr << ", with gaps"; - cerr << ')' << endl; + Message += ", with gaps"; + Message += ')'; } - cerr << " " << Output.Streams[i].Flavor << endl; + Message += "\n "; + Message += Output.Streams[i].Flavor; if (Output.Streams[i].Problem) - cerr << " *** This input format flavor is not supported by the current license key. ***" << endl; + Message += FlavorNotSupported; + } + if (!Output.Attachments.empty()) + { + Message += "\nAttachments:"; + for (const auto& Attachment : Output.Attachments) + { + Message += "\n "; + Message += Attachment.FileName_In.substr(PrefixSize); + } + } + cerr << Message << endl; + if (Global.Log) + { + for (;;) + { + auto Pos = Message.find(FlavorNotSupported); + if (Pos == string::npos) + break; + Message.erase(Pos, strlen(FlavorNotSupported)); + } + *Global.Log += Message; + *Global.Log += '\n'; } } @@ -712,6 +894,7 @@ int main(int argc, const char* argv[]) } } + // FFmpeg if (!Value && Global.Actions[Action_Encode]) Value = Output.Process(Global, RAWcooked.Version == rawcooked::version::v2); @@ -790,5 +973,38 @@ int main(int argc, const char* argv[]) Value = 1; } + // Log + if (Global.Log) + { + file LogFile; + if (LogFile.Open_WriteMode(Global.LogFileName, string(), true)) + { + if (Global.Mode == AlwaysNo) + { + cerr << "Error: File '" << Global.LogFileName << "' already exists.\n"; + Value = 1; + } + else + { + bool WriteLog = false; + if (Global.Mode != AlwaysYes) + { + cerr << "File '" << Global.LogFileName << "' already exists. Overwrite? [y/N] "; + string Result; + getline(cin, Result); + if (!Result.empty() && (Result[0] == 'Y' || Result[0] == 'y')) + WriteLog = true; + else + Value = 1; + } + else + WriteLog = true; + if (WriteLog) + LogFile.Open_WriteMode(Global.LogFileName, string(), false, true); + } + } + LogFile.Write((const uint8_t*)Global.Log->c_str(), Global.Log->size()); + } + return Value; } diff --git a/Source/CLI/Output.cpp b/Source/CLI/Output.cpp index fc4454b6..7043224f 100644 --- a/Source/CLI/Output.cpp +++ b/Source/CLI/Output.cpp @@ -79,10 +79,7 @@ int output::FFmpeg_Command(const char* FileName, global& Global, bool IgnoreReve Global.VideoInputOptions["r"] = FrameRate->second; string Command; - if (Global.BinName.empty()) - Command += "ffmpeg"; - else - Command += Global.BinName; + Command += Global.BinName; Command += " -xerror"; // Disable stdin for ffmpeg @@ -281,14 +278,6 @@ int output::FFmpeg_Command(const char* FileName, global& Global, bool IgnoreReve } for (size_t i = 0; i < Attachments.size(); i++) { - // Info - if (!Global.Quiet) - { - if (!i) - cerr << "Attachments:" << endl; - cerr << " " << Attachments[i].FileName_Out.substr(Attachments[i].FileName_Out.find_first_of("/\\")+1) << endl; - } - if (!Global.Actions[Action_Version2]) { stringstream t; diff --git a/Source/CLI/rawcooked.1 b/Source/CLI/rawcooked.1 index b958ab7c..cfc42b6c 100644 --- a/Source/CLI/rawcooked.1 +++ b/Source/CLI/rawcooked.1 @@ -1,4 +1,4 @@ -.TH "RAWcooked" "1" "https://mediaarea.net/RAWcooked" "23.12" "Bit-by-bit fidelity" +.TH "RAWcooked" "1" "https://mediaarea.net/RAWcooked" "24.11" "Bit-by-bit fidelity" .\" Turn off justification for nroff. .if n .ad l .\" Turn off hyphenation. diff --git a/Source/Lib/Compressed/RAWcooked/RAWcooked.cpp b/Source/Lib/Compressed/RAWcooked/RAWcooked.cpp index cc38064a..fb3ab518 100644 --- a/Source/Lib/Compressed/RAWcooked/RAWcooked.cpp +++ b/Source/Lib/Compressed/RAWcooked/RAWcooked.cpp @@ -15,7 +15,7 @@ using namespace std; // Library name and version const char* LibraryName = "RAWcooked"; -const char* LibraryVersion = "23.12"; +const char* LibraryVersion = "24.11"; // EBML static const uint32_t Name_EBML = 0x0A45DFA3; diff --git a/Source/Lib/License/License.h b/Source/Lib/License/License.h index cdf625a6..d8f0d69f 100644 --- a/Source/Lib/License/License.h +++ b/Source/Lib/License/License.h @@ -24,6 +24,7 @@ ENUM_BEGIN(feature) EncodingOptions, MultipleTracks, SubLicense, + HwAccel, ENUM_END(feature) //--------------------------------------------------------------------------- diff --git a/Source/Lib/License/License_Internal.h b/Source/Lib/License/License_Internal.h index 0f57f7f1..806341fd 100644 --- a/Source/Lib/License/License_Internal.h +++ b/Source/Lib/License/License_Internal.h @@ -51,6 +51,7 @@ const feature_info FeatureInfos[] = { "Encoding options" }, { "More than 2 tracks" }, { "Sub-licensing" }, + { "Hardware acceleration" }, }; static_assert(sizeof(FeatureInfos) / sizeof(feature_info) == feature_Max, "feature_info issue"); diff --git a/Source/Lib/ThirdParty/alphanum/alphanum.hpp b/Source/Lib/ThirdParty/alphanum/alphanum.hpp index a0766a03..4f573df8 100644 --- a/Source/Lib/ThirdParty/alphanum/alphanum.hpp +++ b/Source/Lib/ThirdParty/alphanum/alphanum.hpp @@ -24,7 +24,7 @@ */ /* $Header: /code/doj/alphanum.hpp,v 1.3 2008/01/28 23:06:47 doj Exp $ */ -/* Modifiedz with inline keyword by Jerome Martine */ +/* Modified with inline keyword by Jerome Martinez */ #include #include diff --git a/Source/Lib/Uncompressed/DPX/DPX.cpp b/Source/Lib/Uncompressed/DPX/DPX.cpp index 651f6470..36e2a7e1 100644 --- a/Source/Lib/Uncompressed/DPX/DPX.cpp +++ b/Source/Lib/Uncompressed/DPX/DPX.cpp @@ -96,6 +96,7 @@ static const char* MessageText[] = "ditto key", "ditto key is set to \"same as the previous frame\" but header data differs", "number of image elements", + "packing field value", }; enum code : uint8_t @@ -106,6 +107,7 @@ enum code : uint8_t DittoKey, DittoKey_NotSame, NumberOfElements, + Packing, Max }; @@ -134,6 +136,7 @@ enum class packing : uint8_t Packed, FilledA, FilledB, + Pack3, }; enum flags : uint8_t { @@ -223,6 +226,8 @@ struct dpx_also DPX_Also[] = { { colorspace::Y , 8, endianness::BE, packing::FilledA }, dpx::flavor::Raw_Y_8 }, { { colorspace::Y , 16, endianness::LE, packing::FilledA }, dpx::flavor::Raw_Y_16_LE }, { { colorspace::Y , 16, endianness::BE, packing::FilledA }, dpx::flavor::Raw_Y_16_BE }, + { { colorspace::Y , 16, endianness::LE, packing::Pack3 }, dpx::flavor::Raw_Y_16_LE }, + { { colorspace::Y , 16, endianness::BE, packing::Pack3 }, dpx::flavor::Raw_Y_16_BE }, }; //*************************************************************************** @@ -300,6 +305,7 @@ void dpx::ParseBuffer() uint64_t VersionNumberBig = Get_B4(); switch (VersionNumberBig) { + case 0x00000000LL: // Not conform to spec but it exists and it does not hurt case 0x56312E30LL: case 0x56322E30LL: case 0x76312E30LL: @@ -357,6 +363,7 @@ void dpx::ParseBuffer() bool IsAltern = Info.BitDepth == 10 && Info.ColorSpace != colorspace::RGB && (!memcmp(Buffer.Data() + 160, "Lasergraphics Inc.", 18) // Creator + || !memcmp(Buffer.Data() + 160, "DIAMANT-Film", 12) // Creator || !memcmp(Buffer.Data() + 1556, "Scanity", 7)); // Input device name if (IndustryHeaderSize && InputInfo) @@ -638,10 +645,12 @@ void dpx::ConformanceCheck() uint32_t OffsetToImageData = Get_X4(); if (OffsetToImageData < 1664 || OffsetToImageData > Buffer.Size()) Invalid(invalid::OffsetToImageData); - uint64_t VersionNumber = Get_B8() >> 24; - switch (VersionNumber) + uint64_t VersionNumberBig = Get_B4(); + switch (VersionNumberBig) { - case 0x76312E3000LL: + case 0x00000000LL: + case 0x76312E30LL: + case 0x76322E30LL: Invalid(invalid::VersionNumber); default:; } @@ -666,7 +675,10 @@ void dpx::ConformanceCheck() bool HasEncoding = false; for (uint16_t i = 0; i < NumberOfElements; i++) { - uint32_t Encoding = Get_X4(); + uint16_t Packing = Get_X2(); + if (Packing > (uint16_t)packing::FilledB) + Invalid(invalid::Packing); + uint16_t Encoding = Get_X2(); if (!HasEncoding && Encoding) HasEncoding = true; uint32_t OffsetToData = Get_X4(); diff --git a/Source/Lib/Uncompressed/TIFF/TIFF.cpp b/Source/Lib/Uncompressed/TIFF/TIFF.cpp index e69a90c9..0acefb28 100644 --- a/Source/Lib/Uncompressed/TIFF/TIFF.cpp +++ b/Source/Lib/Uncompressed/TIFF/TIFF.cpp @@ -147,6 +147,12 @@ struct tiff_tested ; } }; +struct dpx_also +{ + tiff_tested Test; + tiff::flavor Flavor; +}; + struct tiff_tested TIFF_Tested[] = { @@ -155,12 +161,17 @@ struct tiff_tested TIFF_Tested[] = { colorspace::RGB , 16, endianness::BE, 6 }, // 1x3x16-bit in 3x16-bit { colorspace::RGBA , 8, endianness::LE, 4 }, // 1x4x 8-bit in 4x 8-bit { colorspace::RGBA , 16, endianness::LE, 8 }, // 1x4x16-bit in 4x16-bit - { colorspace::Y , 8, endianness::BE, 1 }, // 1x4x 8-bit in 1x 8-bit + { colorspace::Y , 8, endianness::LE, 1 }, // 1x4x 8-bit in 1x 8-bit { colorspace::Y , 16, endianness::LE, 2 }, // 1x1x16-bit in 1x16-bit { colorspace::Y , 16, endianness::BE, 2 }, // 1x1x16-bit in 1x16-bit }; static_assert(tiff::flavor_Max == sizeof(TIFF_Tested) / sizeof(tiff_tested), IncoherencyMessage); +struct dpx_also TIFF_Also[] = +{ + { { colorspace::Y , 8, endianness::BE }, tiff::flavor::Raw_Y_8_U }, +}; + //*************************************************************************** // TIFF //*************************************************************************** @@ -607,6 +618,17 @@ void tiff::ParseBuffer() break; } } + if (Flavor == (decltype(Flavor))-1) + { + for (const auto& TIFF_Also_Item : TIFF_Also) + { + if (TIFF_Also_Item.Test == Info) + { + Flavor = (decltype(Flavor))TIFF_Also_Item.Flavor; + break; + } + } + } if (Flavor == (decltype(Flavor))-1) Unsupported(unsupported::Flavor); if (HasErrors()) diff --git a/debian/changelog b/debian/changelog index 78df2897..3416ad04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -rawcooked (23.12-1) unstable; urgency=low +rawcooked (24.11-1) unstable; urgency=low * See History.txt for more info and real dates