0% found this document useful (0 votes)
19 views

Affect Effect Eng - Script 2023

The document provides instructions for automating video summarization using free and open-source tools. It is a multi-step process that involves extracting audio from videos using FFmpeg, transcribing the audio to text using Whisper AI, and analyzing the transcription with AI tools. The first part explains how to install Chocolatey and FFmpeg to extract audio from videos stored on a Windows PC. The second part details using the Whisper AI library and pre-trained models to transcribe the audio files. Scripts are provided to automate extracting audio from multiple video files in parallel using PowerShell 7 or individually using PowerShell 5. The final part states that the transcriptions can then be analyzed using

Uploaded by

edsky2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Affect Effect Eng - Script 2023

The document provides instructions for automating video summarization using free and open-source tools. It is a multi-step process that involves extracting audio from videos using FFmpeg, transcribing the audio to text using Whisper AI, and analyzing the transcription with AI tools. The first part explains how to install Chocolatey and FFmpeg to extract audio from videos stored on a Windows PC. The second part details using the Whisper AI library and pre-trained models to transcribe the audio files. Scripts are provided to automate extracting audio from multiple video files in parallel using PowerShell 7 or individually using PowerShell 5. The final part states that the transcriptions can then be analyzed using

Uploaded by

edsky2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Eng script

Narrator: "Are you battling a mountain of video tutorials, taking up space, and craving
your attention? Here's a solution - automate video summarization using free and open-
source tools! You don't need to be a programming wizard for this – just a Windows PC
with a decent graphics card is enough.

All the scripts are in a github repo. The link is in the video below. Everything is open
sourced and free. Whisper A I is a English speech recognition library from Open A I.

First Part: extract audio frome video. We'll be leveraging two programs: Chocolatey, a
package manager for Windows, and F F M peg, an open-source software for audio
extraction.

Step 1 Install Chocolatey. Open PowerShell with administrator rights. Navigate to the
start menu, search for "PowerShell", right-click, and choose "Run as administrator".
Now run the following commands to install Chocolatey.

Step 2 - Install F F M peg. Chocolatey simplifies the installation process. All you need is
this short command!
After the installation, confirm it by running 'ffmpeg -version'.

Step 3 - Run script to extract audio. Now, let's dive into the main tasks – extracting
audio and transcribing it. Create a main folder. Your video can be in the main folder or in
subfolder. A little note - the default Windows PowerShell 5 will process one video file at
a time. If you're not dealing with a ton of videos, this is okay. But, for larger batches,
consider downloading PowerShell 7, use the option B and run the extraction using multi
thread.

Eng script 1
A. Powershell 5 option

1. hit win key and type powershell

2. change the rootPath to location of your folder,

3. copy and paste to run the single-thread audio to video powershell 5 script

B. Using PowerShell 7 for parallel processing.


For using PowerShell 7, visit 'https://learn.microsoft.com/en-
us/powershell/scripting/install/installing-powershell-on-windows?
view=powershell-7.3#msi' and download 'PowerShell-7.3.6-win-x64.msi'.

1. hit win key and type powershell 7

2. change the rootPath to location of your folder ,

3. adjust '$threadCount = 16' to match your CPU's thread count.

4. copy and paste to run the multi-threads audio to video powershell 7script

After running the audio extraction script, you will see a new m p 3 folder in your main
folder.

Narrator: "Now that we've converted our video content into audio, it's time for second
part transforming audio into text with Whisper AI.

First off, we'll need a Whisper module. download it, extract it and move the folder to this
location. Change the path to your user name.

Visit the following URL, 'https://github.com/Const-me/Whisper/releases', and


download 'whisperPS.zip'. Extract and copy the extracted WhisperPS folder to

Eng script 2
'C:\Users\XXXX\Documents\WindowsPowerShell\Modules', where 'XXXX' is your
username.
Next, you'll need a Whisper A I model for transcribing. I recommend using 'g g m l
medium' for its optimal balance of transcription quality and processing speed.

Now, let's get to transcribing. Here's the script you'll need. Remember, you need to
adjust the model path and the mp3 folder path

Now, let's get to transcribing. Here's the script you'll need. Remember, you must adjust
the model path to where you've saved the downloaded Whisper model and video folder
path

With this script, you can transcribe all the audio files in one go!

Step 3: Analyzing the transcription using your preferred AI tools


[Closing Scene]

Narrator: "And there you have it! Your video tutorial is now summarized, thanks to the
power of AI. Now you can grasp the essence of your lengthy video content in a fraction
of the time. Happy summarizing!"

Eng script 3
# Define the path to the folder containing the video files
$videoFolderPath = "G:\summary\mp3"

# Import the Whisper module


Import-Module WhisperPS -DisableNameChecking
$ModelPath = "G:\01.Video Editing\00.AI transcribe\models\ggml-medium.bin"
$Model = Import-WhisperModel $ModelPath

# Transcribe all *.mp3 and *.m4a files in the defined folder and its subfolders
Get-ChildItem -Path $videoFolderPath -Recurse -include *.mp3, *.m4a | Transcribe-File $Mod
el | foreach { $_ | Export-Text (Join-Path -Path $videoFolderPath -ChildPath ($_.SourceNam
e + ".txt")) }

####!!!
# need to run PowerShell 7
####!!!!

# Define the root path


$rootPath = "C:\fake\fake"

# Create root mp3 directory


$rootMp3Folder = Join-Path -Path $rootPath -ChildPath "mp3"
if(!(Test-Path -Path $rootMp3Folder)) {
New-Item -ItemType directory -Path $rootMp3Folder
}

# Set thread count


$threadCount = 16

# Define all popular video formats


$videoFormats = @("*.mp4", "*.avi", "*.mkv", "*.mov", "*.wmv")

# Get all video files in all directories


$videoFiles = $videoFormats | ForEach-Object { Get-ChildItem -LiteralPath $rootPath -Recur
se -Filter $_ }

# Process each file in parallel


$videoFiles | ForEach-Object -ThrottleLimit $threadCount -Parallel {
# Create the sub directory path
$subDirectoryPath = $_.Directory.FullName.Replace($using:rootPath, $using:rootMp3Folde
r)
# Check and create sub directory if not exists
if(!(Test-Path -Path $subDirectoryPath)) {
New-Item -ItemType directory -Path $subDirectoryPath
}

Eng script 4
# Convert video to mp3
$mp3Path = Join-Path -Path $subDirectoryPath -ChildPath ($_.BaseName + '.mp3')
ffmpeg -i $_.FullName -vn -acodec libmp3lame $mp3Path
}

powershell 5

# Define the root path


$rootPath = "Z:\productivity\5 Day Motivation Challenge"

# Create root mp3 directory


$rootMp3Folder = Join-Path -Path $rootPath -ChildPath "mp3"
if(!(Test-Path -Path $rootMp3Folder)) {
New-Item -ItemType directory -Path $rootMp3Folder
}

# Define all popular video formats


$videoFormats = @("*.mp4", "*.avi", "*.mkv", "*.mov", "*.wmv")

# Get all video files in all directories


$videoFiles = $videoFormats | ForEach-Object { Get-ChildItem -LiteralPath $rootPath -Recur
se -Filter $_ }

# Process each file


$videoFiles | ForEach-Object {
# Create the sub directory path
$subDirectoryPath = $_.Directory.FullName.Replace($rootPath, $rootMp3Folder)
# Check and create sub directory if not exists
if(!(Test-Path -Path $subDirectoryPath)) {
New-Item -ItemType directory -Path $subDirectoryPath
}

# Convert video to mp3


$mp3Path = Join-Path -Path $subDirectoryPath -ChildPath ($_.BaseName + '.mp3')
ffmpeg -i $_.FullName -vn -acodec libmp3lame $mp3Path
}

Prompt:

Please provide an in-depth summary of the key ideas and details in the provided passage. I
nclude the following in your summary:

An introduction briefly describing the overall topic and purpose of the passage
A detailed breakdown of each main idea or section, summarizing the key points and supporti

Eng script 5
ng details
Examples, quotes, or specific data used in the passage to illustrate the concepts
An explanation of how ideas connect and build off each other
A conclusion restating the main purpose and highlighting the most important takeaways
Be comprehensive but concise in summarizing all relevant points and information
Use your own words as much as possible while accurately representing the original content
Please write your response in multiple paragraphs, providing as much relevant detail and e
xpansion on the passage as you can

Eng script 6

You might also like