NAME

FFmpeg::Stream - An audio or video stream from a (multi)media file.

SYNOPSIS

$ff = FFmpeg->new();             #see FFmpeg
#...
$sg = $ff->create_streamgroup(); #see FFmpeg
$st = ($sg->streams())[0];       #this is a FFmpeg::Stream

DESCRIPTION

Objects of this class are not intended to be instantiated directly by the end user. Access FFmpeg::Stream objects using methods in FFmpeg::StreamGroup. See FFmpeg::StreamGroup for more information.

This class represents a media stream in a multimedia file. FFmpeg-Perl represents multimedia file 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 file, 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.

FEEDBACK

See "FEEDBACK" in FFmpeg for details.

AUTHOR

Allen Day <allenday@ucla.edu>

COPYRIGHT AND LICENSE

Copyright (c) 2003-2004 Allen Day

This library is released under GPL, the Gnu Public License

APPENDIX

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.

new()

Usage

my $obj = new FFmpeg::Stream();

Function

Builds a new FFmpeg::Stream object

Returns

an instance of FFmpeg::Stream

Arguments
fourcc (optional)

the four-character-code of the stream's codec. this is not used in any way by FFmpeg.

codec (optional)

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.

codec_tag (optional)

fourcc converted to an unsigned int.

init()

Usage

$obj->init(%arg);

Function

Internal method to initialize a new FFmpeg::Stream object

Returns

true on success

Arguments

Arguments passed to new

fourcc()

Usage
$obj->fourcc();        #get existing value

$obj->fourcc($newval); #set new value
Function

stores the fourcc (four character code) of the stream's codec

Returns

value of fourcc (a scalar)

Arguments
(optional) on set, a scalar

codec()

Usage
$obj->codec();        #get existing FFmpeg::Codec

$obj->codec($newval); #set new FFmpeg::Codec
Function
Returns

an object of class FFmpeg::Codec

Arguments
(optional) on set, an object of class FFmpeg::Codec

codec_tag()

Usage
$obj->codec_tag();        #get existing value

$obj->codec_tag($newval); #set new value
Function

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.

Returns

value of codec_tag (a scalar)

Arguments
(optional) on set, a scalar

is_audio()

Usage

$obj->is_audio(); #get existing value

Function

is the codec of this stream an audio codec?

Returns

a boolean, derived from the associated FFmpeg::Codec, see "codec()".

Arguments

none, read-only

is_video()

Usage

$obj->is_video(); #get existing value

Function

is the codec of this stream a video codec?

Returns

a boolean, derived from the associated FFmpeg::Codec, see "codec()".

Arguments

none, read-only