Call me...


Hello
T he atheist rejects the claim that there is a
supernatural entity or force that interacts with existence...
Because it is a claim without basis.

Atheism makes no claims whatsoever.
Atheism asserts nothing.
Atheism IS NOT an act or an action
IT IS a position
 It has no objective.
Comparatively / Conversely:
Anti-theism IS an act or an action
 It IS NOT a position
 It has an objective.
Not all ATHEISTS are ANTI-THEIST.
All ANTI-THEISTS are ATHEIST.

Saturday, February 8, 2020

Powershell: MP4 to MP3, using FFMPEG


Using your favorite website, to download a YouTube vid, as an MP4 video…
Such as:
https://www.youtube.com/watch?v=NTvcNm1ksRg
https://y2mate.com/youtube/NTvcNm1ksRg

Then using ‘FFMPEG’, to grab the audio, from that MP4… As an MP3 audio file.
This script opens a file select dialog, where you can select the MP4 file…
And then proceeds make the MP3, as a new file – In the source folder.
Then opens up the location of the MP3, wit that file selected.

Notice that there is a flag that will allow the selection of multiple files – It is intentionally called, and set to ‘
Multiselect = $false, because otherwise, every MP3 file, is gonna have the same name, with subsequent files showing numeric iterations parenthetically.

Change the ‘
$fileName’ – That MP4 you downloaded has a crappy file name…
Change the path of the ‘
ffmpeg.exe’.

# Could also do this... The file name, via a $fileName = Read-Host
$fileName = "Billy Squier - Everybody Wants You" #just the name - MP3 is added in below

$fileName = $fileName+".mp3"
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
    InitialDirectory = "C:\Users\Rich\Downloads"
    Multiselect = $false # Multiple files can be chosen
    Filter = 'Video (*.MP4)|*.mp4' # Specified file types
    Title = "Select file..."
    }
[void]$FileBrowser.ShowDialog()
$file = $FileBrowser.FileName
If($FileBrowser.FileNames -like "*\*") {
$Path_to_File = $FileBrowser.FileName
$Path_to_File
}
else {
    Write-Host "Cancelled by user"
    break
}

$OutputFolder = "C:\Users\Rich\Music\"
$Output = $OutputFolder+$fileName
& "C:\Users\Rich\Extracted Applications\ffmpeg\ffmpegWin64\bin\ffmpeg.exe" -i $Path_to_File $Output
# Open the folder the MP3 was saved to,,,
explorer.exe /select,$Output

Powershell - Convert FLAC to MP3, w/ f'older select' dialog.


If you run into a collection of FLAC audio, and want to put them in your iPod…
Convert them to MP3 using ‘FFMPEG

This script opens a folder select, dialog, where you can point to the folder the FLAC file(s) are, then proceeds to convert them to MP3, as a new file – In the source folder.
C:\Users\Rich\Downloads\Beastie Boys - Studio Discography\Beastie Boys - Licensed to Ill 1986\08. No Sleep till Brooklyn - Beastie Boys.flac

C:\Users\Rich\Downloads\Beastie Boys - Studio Discography\Beastie Boys - Licensed to Ill 1986\08. No Sleep till Brooklyn - Beastie Boys.mp3

C:\Users\Rich\Downloads\Beastie Boys - Studio Discography\Beastie Boys - Licensed to Ill 1986\09. Paul Revere - Beastie Boys.flac

C:\Users\Rich\Downloads\Beastie Boys - Studio Discography\Beastie Boys - Licensed to Ill 1986\09. Paul Revere - Beastie Boys.mp3

In the below script, the bitrate is 320, so the ‘lossy’ nature of MP#’s is less significant.

Change the ‘
$SourceFolder’ path.
Change the path of the ‘
ffmpeg.exe’.

You can change the bitrate (‘
-ab 320k’) as well: 96 to 320

$SourceFolder = "C:\Users\Rich\Downloads"

Add-Type -AssemblyName System.Windows.Forms
    $Folder = New-Object System.Windows.Forms.FolderBrowserDialog
        $Folder.ShowNewFolderButton = $false
        $Folder.SelectedPath = $SourceFolder
        $Folder.Description = "Pick one..."
    [void]$Folder.ShowDialog()

# This just makes sure that a subfolder of the $SourceFolder is selected...
If ($($Folder.SelectedPath) -eq $SourceFolder) {
Write-Host "Pick a sub-folder from the dialog..." -ForegroundColor Yellow
break
}
# -LiteralPath, in case there are square brackets '[ ]', et. in the path
$Titles = gci -LiteralPath $Folder.SelectedPath -Recurse | ? {$_.Name -match "flac"}
$Titles | % {
$In = "$($_.FullName)"
$Out = $($_.FullName).Replace('flac','mp3')
$In
$Out
& "C:\Users\Rich\Extracted Applications\ffmpeg\ffmpegWin64\bin\ffmpeg.exe" -i $In -ab 320k -map_metadata 0 -id3v2_version 3 $Out
}