- Classes
- Namespaces
- Interfaces
- Traits
- Index

PHP-FFMpeg API
Class

# FFMpeg\FFProbe\DataMapping\StreamCollection

class StreamCollection implements Countable, IteratorAggregate

## Methods

| __construct(array $streams = array()) |
null|Stream | first() Returns the first stream of the collection, null if the collection is empty. |
StreamCollection | add(Stream $stream) Adds a stream to the collection. |
StreamCollection | videos() Returns a new StreamCollection with only video streams. |
StreamCollection | audios() Returns a new StreamCollection with only audio streams. |
| count() {@inheritdoc} |
array | all() Returns the array of contained streams. |
| getIterator() {@inheritdoc} |

## Details

###
at line 18
`public __construct(array $streams = array())`

#### Parameters

array | $streams |

###
at line 29
`public null|Stream first()`

Returns the first stream of the collection, null if the collection is empty.

#### Return Value

null|Stream |

###
at line 43
`public StreamCollection add(Stream $stream)`

Adds a stream to the collection.

#### Parameters

Stream | $stream |

#### Return Value

StreamCollection |

###
at line 55
`public StreamCollection videos()`

Returns a new StreamCollection with only video streams.

#### Return Value

StreamCollection |

###
at line 67
`public StreamCollection audios()`

Returns a new StreamCollection with only audio streams.

#### Return Value

StreamCollection |

###
at line 77
`public count()`

{@inheritdoc}

###
at line 87
`public array all()`

Returns the array of contained streams.

#### Return Value

array |

###
at line 95
`public getIterator()`

{@inheritdoc}