在powershell中按比特率递归获取文件列表
如何使用 powershell 列出文件(音频)比特率大于 32kbps 的目录中的所有文件(递归)?
How can you list all files (recursively) within a directory where the file (audio) bit rate is greater than 32kbps using powershell?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
从 链接开始 (新链接位置)来自 Johannes ' 帖子,这是一个简单的函数,使用
GetDetailsOf
查找目录中具有最低比特率的所有 mp3 文件:Starting with the link (new link location) from Johannes' post, here is a simple function that uses
GetDetailsOf
to find all mp3 files in a directory with a minimum bitrate:嗯,第一部分肯定是
Get-ChildItem -Recurse
。 然而,对于比特率,您需要更多的脚本。 Microsoft 脚本专家不久前回答了一个问题:如何查找文件的元数据。 您可能可以使用它来获取音频比特率并对其进行过滤。Well, the first part would definitely be a
Get-ChildItem -Recurse
. For the bit rate, you would need some more scripting, however. The Microsoft Scripting Guys answered a question to that a while ago: How Can I find Files' Metadata. You can probably use that to get to the audio bit rate and filter for that.一般来说,如果您想做一些您知道内置 Windows 组件本机支持的事情,最快的途径可能是 COM。 James Brundage 有一篇关于发现的精彩文章这些功能是动态的和动态的 快速使用它们。
In general, if you want to do something you know is natively supported by a built-in Windows component, the fastest route is likely to be COM. James Brundage has a great post on discovering these capabilities on the fly & quickly putting them to use.
了不起的皇帝! 我意识到我有一些 56K MP3,我应该更换为更高质量的(嘿,当驱动器以数百兆而不是演出来测量时,它们被撕裂了,节省空间才是最重要的!)今天早上我想我可能应该看到如果有办法在 Powershell 下做到这一点(我曾经有一个名为 EDIR 的程序,可以从文件中获取该信息,但那是在 Win 95 时代......),并且此页面是 powershell 下的第一个点击OR monad mp3 比特率提取。 谈论幸运!
我还可以想办法改变这一点,这样我就可以浏览并选择所有 16:9、16:10 或左右的壁纸,如果没有别的办法,只是为了对它们进行分类。 16:9-10、4:3(纵向)、9-10:16、3:4(横向)、方形等。 对我来说,这听起来像是我(哈!)业余时间的一个计划。
Stupendous Emperor! I realized that I had some 56K MP3s that I should replace with better quality (heh, they were ripped when drives were measured by hundreds of megs, not gigs, saving space was what mattered!) And I thought this morning that I should probably see if there's a way to do that under Powershell (I used to have a program called EDIR that would get that info from files, but that was back in the days of Win 95...), and this page was the first hit under powershell OR monad mp3 bitrate extraction. Talk about getting lucky!
I could also figure out to change this so I can go through and pick all the wallpapers that are 16:9, 16:10 or thereabouts, if nothing else just to categorize them. 16:9-10, 4:3 (portrait), 9-10:16, 3:4 (landscape), square, and other. Sounds like a plan to me in my (ha!) spare time.