Get list of all files that are not DTS


Influencer

Recommended Posts

I have a mixture of DVD movies and Blu-Ray movies on my server, I think I have most of them sorted but to save from checking every movie does anyone have a script they use to list all media files in a directory with the file name, extension and video/audio codecs?

 

I initially searched for anything that wasn't mkv and went through those, but I've ran across a few MKV's that I ripped a long time ago (when I only had ONE storage drive!) that in order to save space I ripped with lower quality audio losing 5.1 to stereo.

Link to comment

You can do what you want with FileBot.

 

filebot -mediainfo path/to/files --format "{fn} {resolution} {vc} {ac}"

 

I put together a little PowerShell script that queries a share for all the movies, then runs FileBot against each one, and then exports it all out to a CSV.  Im sure there are easier ways to do this, but I'm very familiar with PowerShell.

 

$Now = Get-Date -Format yyyy-MM-dd
$MovieShare = "\\nas\BluRay"
$CSV = "$MovieShare\Movies.$Now.csv"
$Movies = @(Get-ChildItem $MovieShare -Directory | Sort-Object)
$MovieInfo = @()

foreach ($movie in $Movies)
{
Write-Host "Fetching"$movie.fullname"..." -ForegroundColor Magenta
#Finds the largest file
$file = $null
$file = Get-ChildItem $movie.fullname -file | sort length | select -last 1

$FilePath = $file.fullname
$filebot = "C:\Progra~1\FileBot\filebot.exe -mediainfo `"$FilePath`" --format `"{source},{resolution},{vc},{ac}`""

$Return = Invoke-Expression $filebot
$Source = ($Return.split(","))[0]
$Resolution = ($Return.split(","))[1]
$VC = ($Return.split(","))[2]
$AC = ($Return.split(","))[3]
$file | Add-Member -MemberType NoteProperty -Name Source -Value $Source
$file | Add-Member -MemberType NoteProperty -Name Resolution -Value $Resolution
$file | Add-Member -MemberType NoteProperty -Name VC -Value $VC
$file | Add-Member -MemberType NoteProperty -Name AC -Value $AC

$MovieInfo += $file
}

$MovieInfo | select Name,Directory,Source,Resolution,VC,AC | Sort-Object | Export-Csv $CSV -NoTypeInformation

 

muOOcSn.png

Link to comment

Try changing:

 

$Movies = @(Get-ChildItem $MovieShare -Directory | Sort-Object)

to:

$Movies = @(Get-ChildItem $MovieShare | ? { $_.PSIsContainer } | Sort-Object)

 

and

 

$file = Get-ChildItem $movie.fullname -file | sort length | select -last 1

to:

$file = Get-ChildItem $movie.fullname | ? { !$_.PSIsContainer } | sort length | select -last 1

 

 

Link to comment

Updating to PS 4.0 now, if that doesn't work I'll make the changes and see where that leaves me.

 

Thanks for the help, I've got zero powershell experience so your saving me a lot of googling, lol. I know I could script something on the linux side but I don't want to mess with installing the needed packages to get that info. Mainly all of the dependencies for ffmpeg!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.