Strategies for programmatically controlling a commercial DVD player
If you we开发者_JAVA技巧re tasked with operating a commercial DVD player from a computer program, how would you do it?
My company sells a product that does exactly that. We have a couple of different approaches, and they both have major issues:
Get an IR Transmitter, Pretend To Be a Remote Control
Pros: Works with pretty much every commercial DVD player in existence.
Cons: The IR transmitter is another moving part that can (and too frequently does) go wrong. Only allows one-way communication; you can talk to the DVD player, but it can't talk back; you can only tell if it's on or off by seeing if it's putting out a video signal.
Get a DVD Player With an RS-232 Serial Port
Pros: Everything that's "con" with the IR transmitter approach simply goes away. The direct connection is more reliable and allows the code to understand just what the machine is doing.
Cons: Niche market; very few machines actually have an RS-232 port. So, when a manufacturer discontinues a model you've been using, you're left scrambling to find a replacement.
And I suppose for the sake of completeness, I should mention....
Just Use the DVD Drive In the PC
Cons: Boss doesn't like it.
What other approaches are available? I've seen DVD players with USB ports, but the last time I researched the subject, it seemed that was just for playing media stored on an iPhone or the like and not actually a potential control mechanism.
I'm really hoping somebody will say something like "Silly boy, don't you know about the ridiculously common FOO port that allows a home theater system to control the DVD directly? Just get a USB -> FOO converter and you're all set!" But I'm grateful for any options I haven't already considered.
The DVD drive is the way to go.
But if he does not like that, I'd go ahead and get a PIC microcontroller, one with USB built in (forget which part number this is). I'd write code to control this, having the IO lines go out on lead wires that attach to the inside of the front panel buttons. You'd need less than a dozen.
If a model is obseleted, it only changes where the lead wires attach. A hole can be punched out of the back of the commercial DVD player, and one of those little rubber gaskets can seal the USB cable to it. It looks like a regular player with a USB A cable coming out of the back.
The cable itself would be rather cool, I'd buy a few if someone sold them. My "USB betamax VCR" would be hilarious.
Bonus points if you integrate it with Front Row, complete with another icon/menu entry.
Many Blue-Ray players can be controlled via the HDMI port. The protocol is probably proprietary and different for each vendor...
I am am a big fan of optical media but it is a dying form of media.
Have you considered building a small windows or linux computer with an SD card slot (Raspberry Pi) and placing a DVD disc image on the SD card? From there you could write software to playback the DVD from the image and interact with it. You could even use something like Adobe Director as a framework for playing and interacting with the DVD content.
Or you can bypass the DVD image idea altogether and build an interactive framework in Flash, HTML/CSS or Adobe Director which allows you to draw menus on the fly and playback audio/video when a link/button is selected. This would have the added benefit of being more flexible than a multiplexed DVD. You could program the menus to build from an XML file for easy language localization, typo corrections, etc. And you could support playback of video with multiple audio streams, subtitles, etc.
It depends... are you being tasked with controlling (almost) any dvd player, or do you get to decide the model? If you're trying to control whatever AV setup a customer may have, then you're basically required to go the IR transmitter route. And there will still be things you won't be able to handle (like a PS3) without additional hardware.
Most AV devices don't put out any input about their current state short of power draw and video/audio output, and the ones that do usually use proprietary rf (sony is big on this in the near future) or localized standards (like scart in europe). A handful will send/recognize command signals over coax, but that went out of style in the 90s.
精彩评论