js数组对象递归转换树_使用手刹批量转换视频目录树以递归流式传输到Xbox360

js数组对象递归转换树

js数组对象递归转换树

Babies!

I've got many many gigs of 640x480 video of the kids and family taken on my Flip Ultra and then HiDef video taken with a Creative Vado HD, my current favorite pocket video camera. There's also a bunch of random videos taken with whatever video-capable digital camera I might have had with me at the moment.

我在Flip Ultra上拍摄了许多关于孩子和家人的640x480录像,然后是用我目前最喜欢的袖珍摄像机Creative Vado HD拍摄的HiDef录像。 目前,我可能随随带的具有视频功能的数码相机拍摄了大量随机视频。

These are fantastic video cameras (especially the Vado) but unfortunately the output they produce aren't easily streamed to any Game Console like a PS3 or Xbox360.

这些都是出色的摄像机(尤其是Vado),但不幸的是,它们产生的输出不容易流传输到任何游戏机(如PS3或Xbox360)。

There's a glorious open-source multi-platform video transcoder out there called HandBrake. There's also the more sophisticated Expression Encoder. I usually use these applications (both can be called from the command-line) when I need to encode videos.

那里有一个荣耀的开源多平台视频转码器,称为HandBrake 。 还有更复杂的Expression Encoder 。 当我需要对视频进行编码时,通常会使用这些应用程序(都可以从命令行调用)。

I figured I'd just drag the whole folder over and magically these apps would happily encode these hundreds of files and all subdirectories. Both apps are fantastic for doing one file at a time, but when you want to do a thousand, things break down. I googled with Bing for a while then decided that the batch files and MacGyver solutions I was finding were silly. Why not make my own ridiculous solution that at least worked for me?

我想我只是将整个文件夹拖到上面,神奇的是,这些应用程序可以愉快地编码这数百个文件和所有子目录。 两种应用程序都非常适合一次处理一个文件,但是当您要处理一千个文件时,事情就会崩溃。 我在Bing上搜索了一段时间,然后确定我发现的批处理文件和MacGyver解决方案很傻。 为什么不提出自己的荒谬解决方案,至少对我有用?

Even better, why not do it as a one line PowerShell script and see if it's useful to you, Dear Reader? Even better, perhaps you'll re-write it in the comments and one day it won't suck as deeply as it does now.

更好的是,亲爱的读者,为什么不做为一行PowerShell脚本,看看它是否对您有用? 更好的是,也许您会在评论中重新编写它,有一天它不会像现在这样深。

Regardless, this script is currently, happily chewing away at all my videos and even better, these versions are streamable to my Xbox360 from my Windows Home Server. Woot. The Wife is happy.

无论如何,此脚本目前正在愉快地吸引我所有的视频,甚至更好的是,这些版本可以从Windows Home Server传输到我的Xbox360。 哇妻子很高兴。

Here it is:

这里是:

gci . *.avi -R | foreach-object { $newfile = $_.Path + $_.DirectoryName + "\" + $_.BaseName + "-convert" + $_.Extension; &"C:\Program Files (x86)\HandBrake\HandBrakeCLI.exe" -i "$_.FullName" -o "$newfile" --preset "Xbox 360" }

Eek! But what price my immortal soul?

ek! 但是我不朽的灵魂要付出什么代价呢?

You need PowerShell for this, if you don't already have it. If you have Windows 7, it's already installed!

如果尚未安装,则需要PowerShell 。 如果您使用Windows 7,则已经安装了它!

This poorly written script takes every *.avi file in the current (.) folder, and all folders underneath it (-R), and for each of this files, creates a new filename with the word "-convert" inside. It then calls the HandBrake command line (yours may be in "C:\Program Files" so you might need to change that. It uses the Xbox360 preset.

这个脚本编写得不好,会占用当前(。)文件夹中的每个* .avi文件,以及该文件夹下的所有文件夹(-R),并为每个文件创建一个新文件名,并在其中加上“ -convert”一词。 然后,它调用HandBrake命令行(您可能在“ C:\ Program Files”中,因此您可能需要更改它。它使用Xbox360预设。

After this runs, you'll end up with a whole pile of foo-convert.avi files that should/will stream from your machine to your Xbox360 if you are using the free Windows Media Sharing Services. You can also change that profile and convert all your phone for your phone, or whatever you like.

运行此程序后,您将得到一堆foo-convert.avi文件,如果您使用免费的Windows Media共享服务,这些文件应该/将从您的计算机流式传输到Xbox360。 您还可以更改该配置文件,并将所有电话转换为您的电话,或将其转换为任何电话。

Here's a snapshot of a classic baby video shown on the big screen. Don't you want to come over for dinner now? You can watch slideshows of all our still videos and now hours of family movies. Woot! Works For Me.

这是在大屏幕上显示的经典婴儿视频的快照。 你现在不想过来吃晚饭吗? 您可以观看我们所有静态视频的幻灯片演示,以及现在数小时的家庭电影。 ! 为我工作。

PowerShell experts? I'm quite rusty, and I was just interested in the "Getterdone" version. How can we make it better? How about making it so it only updates files that haven't already been encoded?

PowerShell专家? 我很生锈,我只是对“ Getterdone”版本感兴趣。 我们如何才能使其更好? 如何使其仅更新尚未编码的文件呢?

翻译自: https://www.hanselman.com/blog/batch-converting-a-directory-tree-of-videos-recursively-with-handbrake-for-streaming-to-an-xbox360

js数组对象递归转换树

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值