MCPcopy Index your code
hub / github.com/kkroening/ffmpeg-python / __getitem__

Method __getitem__

ffmpeg/nodes.py:216–232  ·  view source on GitHub ↗

Create an outgoing stream originating from this node; syntactic sugar for ``self.stream(label)``. It can also be used to apply a selector: e.g. ``node[0:'a']`` returns a stream with label 0 and selector ``'a'``, which is the same as ``node.stream(label=0, selector='a')``. Ex

(self, item)

Source from the content-addressed store, hash-verified

214 return self.__outgoing_stream_type(self, label, upstream_selector=selector)
215
216 def __getitem__(self, item):
217 """Create an outgoing stream originating from this node; syntactic sugar for ``self.stream(label)``.
218 It can also be used to apply a selector: e.g. ``node[0:'a']`` returns a stream with label 0 and
219 selector ``'a'``, which is the same as ``node.stream(label=0, selector='a')``.
220
221 Example:
222 Process the audio and video portions of a stream independently::
223
224 input = ffmpeg.input('in.mp4')
225 audio = input[:'a'].filter("aecho", 0.8, 0.9, 1000, 0.3)
226 video = input[:'v'].hflip()
227 out = ffmpeg.output(audio, video, 'out.mp4')
228 """
229 if isinstance(item, slice):
230 return self.stream(label=item.start, selector=item.stop)
231 else:
232 return self.stream(label=item)
233
234
235class FilterableStream(Stream):

Callers

nothing calls this directly

Calls 1

streamMethod · 0.95

Tested by

no test coverage detected