FFmpeg::Stream - An audio or video stream from a (multi)media file.
$ff = FFmpeg->new(); #see FFmpeg #... $sg = $ff->create_streamgroup(); #see FFmpeg $st = ($sg->streams())[0]; #this is a FFmpeg::Stream
FFmpeg::Stream objects are not instantiated. Rather, objects are instantiated from FFmpeg::Stream's subclasses FFmpeg::Stream::Video for video streams, FFmpeg::Stream::Audio for audio streams, and FFmpeg::Stream::Data for streams containing neither audio nor video data. Streams identified in the file whose content type cannot be determined are represented by FFmpeg::Stream::Unknown objects.
Access FFmpeg::Stream objects using methods in FFmpeg::StreamGroup. See FFmpeg::StreamGroup for more information.
This class has attributes applicable to any stream type in a multimedia stream, or stream group. FFmpeg-Perl represents multimedia stream group information in a FFmpeg::StreamGroup object, which is a composite of FFmpeg::Stream objects.
FFmpeg::Stream objects don't do much. They just keep track of the media stream's ID within the multimedia stream group, and hold an instance to a FFmpeg::Codec object if the codec of the stream was deducible. See FFmpeg::Codec for more information about how codecs are represented.
See "FEEDBACK" in FFmpeg for details.
Allen Day <allenday@ucla.edu>
Copyright (c) 2003-2004 Allen Day
This library is released under GPL, the Gnu Public License
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a '_'. Methods are in alphabetical order for the most part.
my $obj = new FFmpeg::Stream();
Builds a new FFmpeg::Stream object
an instance of FFmpeg::Stream
the four-character-code of the stream's codec. this is not used in any way by FFmpeg.
a FFmpeg::Codec object used to decode this stream. currently this is only used for decoding purposes, but when transcoding/encoding is implemented in FFmpeg-Perl, this will be used to set an encoding codec.
fourcc converted to an unsigned int.
$obj->init(%arg);
Internal method to initialize a new FFmpeg::Stream object
true on success
Arguments passed to new
$obj->bit_rate(); #get existing value
average bit rate of stream, in bits/second.
value of bit_rate (a scalar)
none, read-only
There are sticky issues here, please refer to "bit_rate()" in FFmpeg::StreamGroup for details.
$obj->bit_rate_tolerance(); #get existing value
variance, essentially, of /bit_rate().
value of bit_rate_tolerance (a scalar)
$obj->codec(); #get existing FFmpeg::Codec $obj->codec($newval); #set new FFmpeg::Codec
an object of class FFmpeg::Codec
(optional) on set, an object of class FFmpeg::Codec
$obj->codec_tag(); #get existing value $obj->codec_tag($newval); #set new value
store the codec tag associated with the stream. this is similar to the value of fourcc(), but is an unsigned int conversion of the fourcc. this attribute is not used in any way.
value of codec_tag (a scalar)
$obj->duration(); #get existing value
duration of stream in microseconds. a stream may not have the same duration as its FFmpeg::StreamGroup container.
value of duration (a scalar) FIXME should be Time::Piece
$obj->fourcc(); #get existing value
stores the fourcc (four character code) of the stream's codec
value of fourcc (a scalar)
$obj->start_time(); #get existing value
start time of stream in seconds. a stream may not begin at the same time as its FFmpeg::StreamGroup container.
value of start_time (a scalar) #FIXME Time::Piece
1 POD Error
The following errors were encountered while parsing the POD:
alternative text '/bit_rate()' contains non-escaped | or /
To install FFmpeg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFmpeg
CPAN shell
perl -MCPAN -e shell install FFmpeg
For more information on module installation, please visit the detailed CPAN module installation guide.