Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Needs the path where your dll is
- Add-Type -Path "C:\taglib-sharp.dll"
- Function Get-VideoDetails {
- param ($targetDirectory)
- Get-ChildItem $targetDirectory -Include *.mp4 -Recurse -Force | ForEach {
- $video = [TagLib.File]::Create($_.FullName)
- New-Object PSObject -Property @{
- Name = $_.FullName
- Duration = $video.Properties.Duration.TotalMinutes
- }
- }
- }
- # Supply your video directory
- Get-VideoDetails "C:\Users\Wesam\Documents\MEGA\EggHead\Courses" | Sort Duration -Descending | Group-Object Item | %{
- New-Object psobject -Property @{
- Item = $_.Name
- Sum = ($_.Group | Measure-Object Duration -Sum).Sum
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement