MPlayerInput

Input object reading images from a video file using MPlayer.

If set up properly, MPlayer will support reading of various media.  You will be able to read DVD, Video CD, HTTP/FTP, RTP/RTSP, MMS/MMST, MPST, SDP, and ordinary files.  MPlayer supports many container formats such as MPEG1/MPEG2, AVI, ASF/WMV/WMA, QT/MOV/MP4, RealVideo, Matroska, NUT, NSV, VIVO, FLI, NuppelVideo, YUV4MPEG, CPK, RoQ, and PVA.  MPlayer also supports unpacking of various video codecs such as MPEG1/MPEG2/MPEG4, WMV7/WMV8/WMV9, RealVideo, SVQ1/SVQ3/Cinepak/RPZA, DV, 3ivx, Intel Indeo, VIVO, MJPEG, AVID, VCR2, ASV2, FLI/FLC, and HuffYUV.

MPlayer is run in slave-mode and controlled using a pipe.  The images are retrieved using a named pipe.  The player is not run in paused mode because otherwise a delay is incurred each time a new frame is requested.  Seeking in the video is not implemented.  Use GNU+Linux with XineInput instead if you need seeking.

Note that there are still countries with laws restricting the distribution of free video decompression software for some codecs.

Inherits

See also

Summary
MPlayerInputInput object reading images from a video file using MPlayer.
Functions
MPlayerInput.new
closeClose the video player and remove the pipe.
inspectReturn string with information about this object.
readRead an image.
status?Indicates whether the video input is still ok.

Functions

MPlayerInput.new

def MPlayerInput.new(mrl,  
pipename =  nil)

Some possible values for the media resource location are

”dvd://1”First track of DVD
”vcd://”Read VCD
”file.mpg”Open video file with filename “file.mpg”

If you create more than one MPlayer process you should provide different filenames for the pipe.  The default pipe-name is “/tmp/hornetseye-mplayer” under GNU+Linux and “\\\\.\\pipe\\hornetseye-mplayer” under Microsoft Windows.

Parameters

mrlMedia resource location
pipenameName of pipe to use for retreiving the frames

close

def close

Close the video player and remove the pipe.  You can call this method to force destruction of this object.

inspect

def inspect

Return string with information about this object.

Returns

Returns a string which looks like this: “MPlayerInput( \”file.mpg\” )”

read

def read

Read an image.  The return value will be of type Frame_ or Sequence_

status?

def status?

Indicates whether the video input is still ok.  At the moment this method does not indicate whether more frames are available.  The API doesn’t offer this information.

def MPlayerInput.new(mrl,  
pipename =  nil)
def close
Close the video player and remove the pipe.
def inspect
Return string with information about this object.
def read
Read an image.
def status?
Indicates whether the video input is still ok.
Input object reading images from a video file using Xine.
Base class for different types of input sources for images.
HornetsEye allows you to capture frames from videos by using MPlayer
This class provides fast (multi-dimensional) Ruby arrays where all elements are of the same type.
Close