Last active
February 19, 2025 10:33
-
-
Save elico/eb28eb567140f9c2adab9e73af881db3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$outDir = ".\out\" | |
$sourceDir = ".\in\" | |
$historyDir = ".\history\" | |
$workDir = ".\working\" | |
$imageFile = "michael.png" | |
$inputFormat = "mp3" | |
$outputFormat = "mp4" | |
mkdir "$sourceDir" -Force | |
mkdir "$outDir" -Force | |
mkdir "$historyDir" -Force | |
mkdir "$workDir" -Force | |
$inFiles = Get-Childitem $sourceDir -Filter "*.$inputFormat" | |
ForEach ($f in $inFiles) { | |
$newFilename = $f.Name.Replace(".mp3", ".mp4") | |
ffmpeg -i $f.FullName -loop 1 -i $imageFile -c:a copy -c:v libx264 -preset ultrafast -tune stillimage -shortest "$workDir$newFilename" | |
$f | Move-Item -Verbose -destination $historyDir | |
Move-Item -Verbose -Path "$workDir$newFilename" -destination $outDir | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment