Sorry for a very late reply, due to the very poor/varying quality of affordable DL Blu-ray I pretty much stopped using them. But I used Google Gemini AI to write a script in Powershell, for BD movies, basically it is like this :
First a couple of notes: I don't know Powershell. This was pretty much entirely written by Gemini. I just changed the layer size a bit. The code has no error correction or anything. If the STREAM-folder is close to 50GB it won't work. It will only accept the STREAM-folder (for BD movies, script depends on all big files being in the same folder - for data discs it could be other folder than STREAM folder obviously).
param(
# Path to the folder containing the files
[Parameter(Mandatory=$true)]
[string] $FolderPath
)
# Set the size limits in bytes
$maxSizeLayer = 24000000000
# Function to get the total size of files
function Get-TotalFileSize {
param(
[Parameter(Mandatory=$true)]
[string[]] $FilePaths
)
$fileSizes = $FilePaths | ForEach-Object { Get-Item $_ -Force | Select-Object Length }
$fileSizes | Measure-Object -Sum | Select-Object -ExpandProperty Sum
}
# Get all files in the folder sorted alphabetically
$files = Get-ChildItem -Path $FolderPath -File | Sort-Object Name
# Track the total size and last added file
$totalSize = 0
$lastFile
# Loop through files until reaching limit
foreach ($file in $files) {
$fileSize = $file.Length
if ($totalSize + $fileSize -lt $maxSizeLayer) {
$totalSize += $fileSize
$lastFile = $file
} else {
break
}
}
$paddingFileSize = (25GB - $totalSize)
# Calculate padding file size
$paddingSize = $paddingFileSize
# Check if padding is needed
if ($paddingFileSize -gt 0) {
# Create padding filename based on last added file
$paddingFileName = ($lastFile.Name.Split('.')[-2] + "dummy") + "." + ($lastFile.Name.Split('.')[-1])
$paddingFilePath = Join-Path $FolderPath -ChildPath $paddingFileName
# Write message about padding file
Write-Host "Creating padding file: $paddingFileName with size: $($paddingSize / 1KB) KB"
fsutil file createNew $paddingFilePath $paddingSize
} else {
Write-Host "No padding file needed. Total size reached the limit."
}
To use this script, create a text document, for example padder.ps1 , I put my on my Desktop. Then I open Powershell, , and run
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
(My Windows is restricted from running scripts in Powershell)
I then drag my script to the Powershell windows, run it, and drag the STREAM-folder, and will get something looking like this:
PS C:\Users\MattKarma> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
PS C:\Users\MattKarma> C:\Users\MattKarma\Desktop\Padder.ps1
cmdlet Padder.ps1 at command pipeline position 1
Supply values for the following parameters:
FolderPath: C:\multiAVCHD\AVCHD\BDMV\STREAM
Creating padding file: 00006dummy.m2ts with size: 3742564 KB
File C:\multiAVCHD\AVCHD\BDMV\STREAM\00006dummy.m2ts is created
PS C:\Users\MattKarma>
Again, this is a very crude solution, and it also assumes the burning program burns files alphabetically and not based on when files were created or something else.
It also assumes that the size of .mt2ts files are reasonable, I use something like 4000 MB m2ts media split in MultiAVCHD. If you have 3 15GB .m2ts files it won't work.