mirror of
https://github.com/kkroening/ffmpeg-python.git
synced 2025-08-22 04:46:04 +08:00
Update docs
This commit is contained in:
parent
1e63419a93
commit
c162eab2a9
@ -49,12 +49,11 @@ class Stream(object):
|
|||||||
Select a component (audio, video) of the stream.
|
Select a component (audio, video) of the stream.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
Process the audio and video portions of a stream independently::
|
Process the audio and video portions of a stream independently::
|
||||||
|
|
||||||
input = ffmpeg.input('in.mp4')
|
input = ffmpeg.input('in.mp4')
|
||||||
audio = input['a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
|
audio = input[:'a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
|
||||||
video = input['v'].hflip()
|
video = input[:'v'].hflip()
|
||||||
out = ffmpeg.output(audio, video, 'out.mp4')
|
out = ffmpeg.output(audio, video, 'out.mp4')
|
||||||
"""
|
"""
|
||||||
if self.selector is not None:
|
if self.selector is not None:
|
||||||
@ -134,8 +133,16 @@ class Node(KwargReprNode):
|
|||||||
|
|
||||||
def __getitem__(self, item):
|
def __getitem__(self, item):
|
||||||
"""Create an outgoing stream originating from this node; syntactic sugar for ``self.stream(label)``.
|
"""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:'audio']`` returns a stream with label 0 and
|
It can also be used to apply a selector: e.g. ``node[0:'a']`` returns a stream with label 0 and
|
||||||
selector ``'audio'``, which is the same as ``node.stream(label=0, selector='audio')``.
|
selector ``'a'``, which is the same as ``node.stream(label=0, selector='a')``.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Process the audio and video portions of a stream independently::
|
||||||
|
|
||||||
|
input = ffmpeg.input('in.mp4')
|
||||||
|
audio = input[:'a'].filter_("aecho", 0.8, 0.9, 1000, 0.3)
|
||||||
|
video = input[:'v'].hflip()
|
||||||
|
out = ffmpeg.output(audio, video, 'out.mp4')
|
||||||
"""
|
"""
|
||||||
if isinstance(item, slice):
|
if isinstance(item, slice):
|
||||||
return self.stream(label=item.start, selector=item.stop)
|
return self.stream(label=item.start, selector=item.stop)
|
||||||
|
@ -175,7 +175,7 @@ def test_filter_with_selector():
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_filter_with_bad_selectors():
|
def test_get_item_with_bad_selectors():
|
||||||
input = ffmpeg.input(TEST_INPUT_FILE1)
|
input = ffmpeg.input(TEST_INPUT_FILE1)
|
||||||
|
|
||||||
with pytest.raises(ValueError) as excinfo:
|
with pytest.raises(ValueError) as excinfo:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user