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

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.

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

bit_rate()

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

average bit rate of stream, in bits/second.

Returns

value of bit_rate (a scalar)

Arguments

none, read-only

Notes

There are sticky issues here, please refer to "bit_rate()" in FFmpeg::StreamGroup for details.

bit_rate_tolerance()

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

variance, essentially, of /bit_rate().

Returns

value of bit_rate_tolerance (a scalar)

Arguments

none, read-only

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

none, read-only

duration()

Usage
$obj->duration(); #get existing value
$obj->duration(format=>'HMS'); #get existing value in HH::MM::SS format
Function

duration of stream in seconds. a stream may not have the same duration as its FFmpeg::StreamGroup container.

Returns

value of duration (a float), or a formatted time string.

Arguments

none, read-only

fourcc()

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

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

Returns

value of fourcc (a scalar)

Arguments

none, read-only

start_time()

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

start time of stream in seconds. a stream may not begin at the same time as its FFmpeg::StreamGroup container.

Returns

value of start_time (a float)

Arguments

none, read-only

1 POD Error

The following errors were encountered while parsing the POD:

Around line 199:

alternative text '/bit_rate()' contains non-escaped | or /