@@ -49,12 +49,11 @@ def __getitem__(self, index):
49
49
Select a component (audio, video) of the stream.
50
50
51
51
Example:
52
-
53
52
Process the audio and video portions of a stream independently::
54
53
55
54
input = ffmpeg.input('in.mp4')
56
- audio = input['a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
57
- video = input['v'].hflip()
55
+ audio = input[: 'a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
56
+ video = input[: 'v'].hflip()
58
57
out = ffmpeg.output(audio, video, 'out.mp4')
59
58
"""
60
59
if self .selector is not None :
@@ -134,8 +133,16 @@ def stream(self, label=None, selector=None):
134
133
135
134
def __getitem__ (self , item ):
136
135
"&quo
DB22
t;"Create an outgoing stream originating from this node; syntactic sugar for ``self.stream(label)``.
137
- It can also be used to apply a selector: e.g. ``node[0:'audio']`` returns a stream with label 0 and
138
- selector ``'audio'``, which is the same as ``node.stream(label=0, selector='audio')``.
136
+ It can also be used to apply a selector: e.g. ``node[0:'a']`` returns a stream with label 0 and
137
+ selector ``'a'``, which is the same as ``node.stream(label=0, selector='a')``.
138
+
139
+ Example:
140
+ Process the audio and video portions of a stream independently::
141
+
142
+ input = ffmpeg.input('in.mp4')
143
+ audio = input[:'a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
144
+ video = input[:'v'].hflip()
145
+ out = ffmpeg.output(audio, video, 'out.mp4')
139
146
"""
140
147
if isinstance (item , slice ):
141
148
return self .stream (label = item .start , selector = item .stop )
0 commit comments