Compare commits

..

No commits in common. "main" and "0.0.6" have entirely different histories.
main ... 0.0.6

3 changed files with 42 additions and 55 deletions

View file

@ -206,11 +206,11 @@ class Program
try
{
await clientWebSocket.ConnectAsync(tickerUri, CancellationToken.None);
Console.WriteLine("[TickerHook] Connected to WebSocket.");
Console.WriteLine("Connected to TickerHook WebSocket.");
}
catch (Exception ex)
{
Console.WriteLine($"[TickerHook] [ERROR] Unable to connect to WebSocket: {ex.Message}");
Console.WriteLine($"Error connecting to TickerHook WebSocket: {ex.Message}");
return false;
}
@ -224,13 +224,13 @@ class Program
}
catch (Exception ex)
{
Console.WriteLine($"[TickerHook] [ERROR] Unable to receive message: {ex.Message}");
Console.WriteLine($"Error receiving message: {ex.Message}");
reconnecting = true;
break;
}
var message = Encoding.UTF8.GetString(buffer, 0, result.Count).Trim().ToUpper();
Console.WriteLine($"[TickerHook] Received message: {message}");
Console.WriteLine($"Received message: {message}");
if (message == lastMessage && !message.Contains("SELECT FROM"))
{
@ -301,11 +301,11 @@ class Program
_waveSource.Dispose();
};
_waveSource.StartRecording();
Console.WriteLine("[WASAPI] Audio recording started.");
Console.WriteLine("WASAPI Audio recording started.");
}
catch (Exception ex)
{
Console.WriteLine($"[WASAPI] [ERROR] Unable to start audio recording:{ex.Message}");
Console.WriteLine($"Error starting audio recording: {ex.Message}");
}
}
@ -316,9 +316,20 @@ class Program
var date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
_audioFilePath = $"{_ffmpegFolderPath}\\{songName}_{date}.wav";
var procid = GetFirstProcessIdByName(_gameProcessName);
var directory = Path.GetDirectoryName(_audioFilePath);
if (directory == null)
{
throw new InvalidOperationException("Invalid audio file path.");
}
Directory.CreateDirectory(directory);
var args = $"{procid} includetree \"{_audioFilePath}\"";
var procid = GetFirstProcessIdByName(_gameProcessName);
if (procid == -1)
{
throw new InvalidOperationException("Target process is not running.");
}
var args = $"{procid} includetree {_audioFilePath}";
_recorderprocess = new Process
{
StartInfo = new ProcessStartInfo
@ -327,36 +338,19 @@ class Program
Arguments = args,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
_recorderprocess.OutputDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
Console.WriteLine($"[applb]: {e.Data}");
}
};
_recorderprocess.ErrorDataReceived += (sender, e) =>
{
if (!string.IsNullOrEmpty(e.Data))
{
Console.WriteLine($"[applb] [ERROR]: {e.Data}");
}
};
_recorderprocess.Start();
_recorderprocess.BeginOutputReadLine();
_recorderprocess.BeginErrorReadLine();
}
catch (Exception ex)
{
Console.WriteLine($"[applb] [ERROR] Unable to start audio recording: {ex.Message}");
Console.WriteLine($"Error starting audio recording: {ex.Message}");
}
}
private static void StartFfmpegRecording(string songName)
{
var date = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
@ -377,7 +371,7 @@ class Program
};
_ffmpegProcess.Start();
Console.WriteLine("[FFmpeg] recording started.");
Console.WriteLine("FFmpeg recording started.");
}
private static string GetGraphicsCard()
@ -396,18 +390,18 @@ class Program
DateTime oneWeekAgo = DateTime.Now.AddDays(-7);
if (fileCreationTime > oneWeekAgo)
{
Console.WriteLine("[DxDiagHelper] Using cached dxdiag_output.txt.");
Console.WriteLine("[DxDiagHelper] Delete your cached dxdiag_output.txt if your system configuration changed or if you're unsure of it");
Console.WriteLine("Using cached dxdiag_output.txt.");
Console.WriteLine("Delete your cached dxdiag_output.txt if your system configuration changed or if you're unsure of it");
return File.ReadAllText(dxDiagFilePath);
}
else
{
Console.WriteLine("[DxDiagHelper] dxdiag_output.txt is older than a week, regenerating...");
Console.WriteLine("dxdiag_output.txt is older than a week, regenerating...");
}
}
else
{
Console.WriteLine("[DxDiagHelper] dxdiag_output.txt does not exist, generating...");
Console.WriteLine("dxdiag_output.txt does not exist, generating...");
}
return RunDxDiag(dxDiagFilePath);
}
@ -425,7 +419,7 @@ class Program
CreateNoWindow = true
}
};
Console.WriteLine("[DxDiagHelper] Gathering GPU information for Hardware Accelerated Video");
Console.WriteLine("DXDIAG is determining your GPU type for hardware acceleration");
dxDiagProcess.Start();
dxDiagProcess.WaitForExit();
@ -448,29 +442,29 @@ class Program
private static string GetHardwareEncoder()
{
var graphicsCard = GetGraphicsCard();
Console.WriteLine($"[DxDiagHelper] Using {graphicsCard} for hardware video acceleration");
Console.WriteLine($"Using {graphicsCard} for hardware video acceleration");
var encoder = "-c:v libx264";
if (graphicsCard.Contains("NVIDIA"))
{
encoder = "-c:v h264_nvenc";
Console.WriteLine("[DxDiagHelper] Using NVIDIA hardware encoding (h264_nvenc).");
Console.WriteLine("Using NVIDIA hardware encoding (h264_nvenc).");
}
else if (graphicsCard.Contains("AMD"))
{
encoder = "-c:v h264_amf";
Console.WriteLine("[DxDiagHelper] Using AMD hardware encoding (h264_amf).");
Console.WriteLine("Using AMD hardware encoding (h264_amf).");
}
else if (graphicsCard.Contains("INTEL"))
{
encoder = "-c:v h264_qsv";
Console.WriteLine("[DxDiagHelper] Using Intel hardware encoding (h264_qsv).");
Console.WriteLine("Using Intel hardware encoding (h264_qsv).");
}
else
{
Console.WriteLine("[DxDiagHelper] [WARN] No recognized hardware encoder found, using CPU (libx264).");
Console.WriteLine("[DxDiagHelper] [WARN] Cpu encoding might present some graphical glitches such as desync at the end of the video or really slow framerates");
Console.WriteLine("No recognized hardware encoder found, using CPU (libx264).");
Console.WriteLine("Cpu encoding might present some graphical glitches such as desync at the end of the video or really slow framerates");
}
return encoder;
@ -514,7 +508,7 @@ class Program
private static void StopAudioRecording()
{
_waveSource?.StopRecording();
Console.WriteLine("[WASAPI] Audio recording stopped.");
Console.WriteLine("WASAPI Audio recording stopped.");
}
private static void StopFfmpegRecording()
{
@ -523,7 +517,7 @@ class Program
_ffmpegProcess.Kill();
_ffmpegProcess.WaitForExit();
_ffmpegProcess = null!;
Console.WriteLine("[FFmpeg] recording stopped.");
Console.WriteLine("FFmpeg recording stopped.");
}
}
private static void CombineAudioAndVideo(string videoFilePath, string audioFilePath, string songName)
@ -545,7 +539,7 @@ class Program
using var process = Process.Start(processInfo);
if (process == null)
{
Console.WriteLine("[FFmpeg] [FATAL] Unable to start.");
Console.WriteLine("FFmpeg failed to start.");
return;
}
@ -556,8 +550,8 @@ class Program
Console.WriteLine("FFmpeg Error: " + error);
Console.WriteLine(File.Exists(combinedOutputFilePath)
? "[FFmpeg] Audio and video have been successfully combined."
: "[FFmpeg] [FATAL] Failed to combine audio and video. Check the logs for errors.");
? "Audio and video have been successfully combined."
: "Failed to combine audio and video. Check the logs for errors.");
File.Delete(videoFilePath);
File.Delete(audioFilePath);
}

View file

@ -7,13 +7,9 @@ Dalla versione 0.0.4 in poi sarà possibile avere una certa flessibilità nelle
Il nuovo file [prop](https://git.mercurio.moe/Mercury/2dxAutoClip/src/branch/main/2dxAutoClip/artifacts/prop.txt) consentirà all'utente di regolare finemente alcune impostazioni come la risoluzione di registrazione (Consigliamo registrare a 720p tutti le versioni precedenti a Resident), il Constant Rate Factor (CRF) che determina la qualità e la velocità della registrazione, anche se suggeriamo di mantenerlo al valore predefinito, e il framerate del video sorgente; anche in questo caso, suggeriamo di mantenerlo a 60 o 120, poiché l'output finale forzerà il framerate a 60. Questa versione consente anche all'utente di passare alla registrazione con `spice`, `inject` e `launcher` invece di `spice64` per registrare versioni più vecchie o giochi avviati da BemaniTools.
## Requisiti:
- **ALMENO Windows 10 build 20348**
- Un'installazione abbastanza recente di beatmania iidx con [TickerHook](https://github.com/Radioo/TickerHook) in esecuzione. Tutti i crediti vanno all'autore originale
- Circa 2MB per estrarre la versione precompilata dell'applicazione e 100MB una volta completato il download dei file di supporto come FFMPEG e AppLbCap
- Runtime [.net 8 (64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/runtime-8.0.8-windows-x64-installer) per l'esecuzione, SDK [.net 8 (64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/sdk-8.0.401-windows-x64-installer) se si desidera compilarlo autonomamente
- FFMPEG aggiunto al PATH di sistema (opzionale. Il programma scaricherà una versione precompilata di FFMPEG se non ne trova una)
- ApplicationLoopbackCapture verrà scaricato a runtime. In alternativa, puoi scaricarlo da [qui](https://git.mercurio.moe/Mercury/2dxAutoClip-AppLbHelper) e compilarlo autonomamente (richiede VS 2019+)
- Un'installazione di beatmania IIDX relativamente moderna che utilizza [TickerHook](https://github.com/Radioo/TickerHook).
- Circa 150mb per estrarre la versione precompilata dell'applicazione.
- Il runtime [.net 8 (64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/runtime-8.0.8-windows-x64-installer) per eseguirlo, oppure l'SDK [.net 8 (64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/sdk-8.0.401-windows-x64-installer) se vuoi compilarlo da solo.
## Istruzioni:
Le istruzioni per l'esecuzione sono piuttosto semplici:

View file

@ -10,12 +10,9 @@ the new [prop](https://git.mercurio.moe/Mercury/2dxAutoClip/src/branch/main/2dxA
This version also allows the user to switch to recording `spice` instead of `spice64` for the aforementioned older styles
## Requirements:
- **AT LEAST Windows 10 build 20348**
- A fairly modern beatmania iidx install running [TickerHook](https://github.com/Radioo/TickerHook). All credit goes to original author
- About 2mb to extract the precompiled version of the application, and 100MB once it finishes downloading helper files such as FFMPEG and AppLbCap
- About 150mb to extract the precompiled version of the application
- [.net 8 runtime(64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/runtime-8.0.8-windows-x64-installer) for running, [.net8 SDK(64 bit)](https://dotnet.microsoft.com/it-it/download/dotnet/thank-you/sdk-8.0.401-windows-x64-installer) if you want to build it yourself
- FFMPEG added to path (optional. the program will download a prebuilt version of ffmpeg if it can't find one)
- ApplicationLoopbackCapture will be downloaded at runtime. you can alternatively pull it from [here](https://git.mercurio.moe/Mercury/2dxAutoClip-AppLbHelper) and build it yourself (requires VS 2019+)
## Instructions:
Instructions for running boil down pretty much to: