0% found this document useful (0 votes)
27 views1 page

Scripts

This script extracts frames from a list of video files at a specified frame rate of 12 FPS and saves them as PNG images in designated directories. It checks for the presence of ffmpeg and verifies the existence of each video file before processing. If successful, it creates a directory for each video and outputs the extracted frames with a specific naming pattern.

Uploaded by

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

Scripts

This script extracts frames from a list of video files at a specified frame rate of 12 FPS and saves them as PNG images in designated directories. It checks for the presence of ffmpeg and verifies the existence of each video file before processing. If successful, it creates a directory for each video and outputs the extracted frames with a specific naming pattern.

Uploaded by

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

$Fps = 12

$OutRoot = "C:\Users\Amita\frames" $VidPaths = @(


"C:\Users\Amita\Downloads\e0f58577-4075-4fbd-bab2-55adc55b9ab6.mp4",
"C:\Users\Amita\Downloads\62900fba-0469-4ca4-b98a-33a0c88d8262.mp4",
"C:\Users\Amita\Downloads\9672dc81-9d3a-4b32-9840-585388b79e2c.mp4",
"C:\Users\Amita\Downloads\b32349b0-fa6e-4fb5-a02c-34c47bb3f9e9.mp4",
"C:\Users\Amita\Downloads\0acf8ed7-ffa8-445f-8da6-cb12a48de933.mp4",
"C:\Users\Amita\Downloads\copy_0926ED19-4FC7-43BD-9650-03D14A906526.mov",
"C:\Users\Amita\Downloads\221199c9-44c0-4e51-8fed-51505f411abf.mp4",
"C:\Users\Amita\Downloads\35e0cf30-6e33-4701-afd1-e31829555840.mp4",
"C:\Users\Amita\Downloads\7510768b-8688-4ab4-9a4d-1b87440dac4a.mp4",
"C:\Users\Amita\Downloads\f56dbe62-f663-4112-8986-33349f87af88.mp4",
"C:\Users\Amita\Downloads\94904338-c265-4e1f-8212-8c14b01f798b.mp4",
"C:\Users\Amita\Downloads\a933311b-f35d-4952-951f-5eb5c9b1091d.mp4",
"C:\Users\Amita\Downloads\2ac978e9-2e3a-4c6b-8571-ed7f3f4ba352.mp4",
"C:\Users\Amita\Downloads\94f11c72-70bb-417e-bda6-18557d0860d3.mp4"
)
# -------- ‫ קוד‬--------
if (-not (Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
Write-Error "ffmpeg.exe ‫חייב להיות ב‬-PATH ‫ ;"או ליד הסקריפט‬exit 1
}

foreach ($vid in $VidPaths) {


if (-not (Test-Path $vid)) { Write-Warning "‫לא נמצא‬: $vid"; continue }

$name = [IO.Path]::GetFileNameWithoutExtension($vid)
$outDir = Join-Path $OutRoot $name
New-Item -ItemType Directory -Path $outDir -Force | Out-Null

$outPattern = Join-Path $outDir ("{0}_%03d.png" -f $name)


Write-Host ">> Extracting $vid -> $outPattern"
& ffmpeg -loglevel error -y -i $vid -vf "fps=$Fps" $outPattern
}
Write-Host "`n‫"✔ סיימתי‬

You might also like