@@ -125,10 +134,12 @@
O
|
|
diff --git a/doc/html/index.html b/doc/html/index.html
index 5f41caa..ede0c7c 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -47,85 +47,278 @@
-
-
ffmpeg. colorchannelmixer (parent, *args, **kwargs)
+ffmpeg. colorchannelmixer (parent_node, *args, **kwargs)
Adjust video input frames by re-mixing color channels.
-FFmpeg colorchannelmixer filter
+Official documentation: colorchannelmixer
-
-
ffmpeg. concat (*parents, **kwargs)
-
+ffmpeg. concat (*parent_nodes, **kwargs)
+Concatenate audio and video streams, joining them together one after the other.
+The filter works on segments of synchronized video and audio streams. All segments must have the same number of
+streams of each type, and that will also be the number of streams at output.
+
+
+
+
+Parameters: | unsafe – Activate unsafe mode: do not fail if segments have a different format. |
+
+
+
+Related streams do not always have exactly the same duration, for various reasons including codec frame size or
+sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be
+concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the
+last one), and if necessary pad shorter audio streams with silence.
+For this filter to work correctly, all segments must start at timestamp 0.
+All corresponding streams must have the same parameters in all segments; the filtering system will automatically
+select a common pixel format for video streams, and a common sample format, sample rate and channel layout for
+audio streams, but other settings, such as resolution, must be converted explicitly by the user.
+Different frame rates are acceptable but will result in variable frame rate at output; be sure to configure the
+output file to handle it.
+Official documentation: concat
+
-
-
ffmpeg. drawbox (parent, x, y, width, height, color, thickness=None, **kwargs)
-
+ffmpeg. drawbox (parent_node, x, y, width, height, color, thickness=None, **kwargs)
+Draw a colored box on the input image.
+
+
+
+
+Parameters: |
+- x – The expression which specifies the top left corner x coordinate of the box. It defaults to 0.
+- y – The expression which specifies the top left corner y coordinate of the box. It defaults to 0.
+- width – Specify the width of the box; if 0 interpreted as the input width. It defaults to 0.
+- heigth – Specify the height of the box; if 0 interpreted as the input height. It defaults to 0.
+- color – Specify the color of the box to write. For the general syntax of this option, check the “Color” section
+in the ffmpeg-utils manual. If the special value invert is used, the box edge color is the same as the
+video with inverted luma.
+- thickness – The expression which sets the thickness of the box edge. Default value is 3.
+- w – Alias for
width .
+- h – Alias for
height .
+- c – Alias for
color .
+- t – Alias for
thickness .
+
+ |
+
+
+
+Official documentation: drawbox
+
-
-
ffmpeg. hflip (parent)
-
+ffmpeg. hflip (parent_node)
+Flip the input video horizontally.
+Official documentation: hflip
+
-
-
ffmpeg. hue (parent, **kwargs)
-
+ffmpeg. hue (parent_node, **kwargs)
+Modify the hue and/or the saturation of the input.
+
+
+
+
+Parameters: |
+- h – Specify the hue angle as a number of degrees. It accepts an expression, and defaults to “0”.
+- s – Specify the saturation in the [-10,10] range. It accepts an expression and defaults to “1”.
+- H – Specify the hue angle as a number of radians. It accepts an expression, and defaults to “0”.
+- b – Specify the brightness in the [-10,10] range. It accepts an expression and defaults to “0”.
+
+ |
+
+
+
+Official documentation: hue
+
-
-
ffmpeg. overlay (main_parent, overlay_parent, eof_action=’repeat’, **kwargs)
-
+ffmpeg. overlay (main_parent_node, overlay_parent_node, eof_action=’repeat’, **kwargs)
+Overlay one video on top of another.
+
+
+
+
+Parameters: |
+- x – Set the expression for the x coordinates of the overlaid video on the main video. Default value is 0. In
+case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
+within the output visible area).
+- y – Set the expression for the y coordinates of the overlaid video on the main video. Default value is 0. In
+case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
+within the output visible area).
+- eof_action –
The action to take when EOF is encountered on the secondary input; it accepts one of the following
+values:
+
+repeat : Repeat the last frame (the default).
+endall : End both streams.
+pass : Pass the main input through.
+
+
+- eval –
Set when the expressions for x, and y are evaluated.
+It accepts the following values:
+
+
+init : only evaluate expressions once during the filter initialization or when a command is
+- processed
+
+
+frame : evaluate expressions for each incoming frame
+
+Default value is frame .
+
+- shortest – If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.
+- format –
Set the format for the output video.
+It accepts the following values:
+
+yuv420 : force YUV420 output
+yuv422 : force YUV422 output
+yuv444 : force YUV444 output
+rgb : force packed RGB output
+gbrp : force planar RGB output
+
+Default value is yuv420 .
+
+- rgb (deprecated) – If set to 1, force the filter to accept inputs in the RGB color space. Default value is 0.
+This option is deprecated, use format instead.
+- repeatlast – If set to 1, force the filter to draw the last overlay frame over the main input until the end of
+the stream. A value of 0 disables this behavior. Default value is 1.
+
+ |
+
+
+
+Official documentation: overlay
+
-
-
ffmpeg. setpts (parent, expr)
-
+ffmpeg. setpts (parent_node, expr)
+Change the PTS (presentation timestamp) of the input frames.
+
+
+
+
+Parameters: | expr – The expression which is evaluated for each frame to construct its timestamp. |
+
+
+
+Official documentation: setpts, asetpts
+
-
-
ffmpeg. trim (parent, **kwargs)
-
+ffmpeg. trim (parent_node, **kwargs)
+Trim the input so that the output contains one continuous subpart of the input.
+
+
+
+
+Parameters: |
+- start – Specify the time of the start of the kept section, i.e. the frame with the timestamp start will be the
+first frame in the output.
+- end – Specify the time of the first frame that will be dropped, i.e. the frame immediately preceding the one
+with the timestamp end will be the last frame in the output.
+- start_pts – This is the same as start, except this option sets the start timestamp in timebase units instead of
+seconds.
+- end_pts – This is the same as end, except this option sets the end timestamp in timebase units instead of
+seconds.
+- duration – The maximum duration of the output in seconds.
+- start_frame – The number of the first frame that should be passed to the output.
+- end_frame – The number of the first frame that should be dropped.
+
+ |
+
+
+
+Official documentation: trim
+
-
-
ffmpeg. vflip (parent)
-
+ffmpeg. vflip (parent_node)
+Flip the input video vertically.
+Official documentation: vflip
+
-
-
ffmpeg. zoompan (parent, **kwargs)
-
+ffmpeg. zoompan (parent_node, **kwargs)
+Apply Zoom & Pan effect.
+
+
+
+
+Parameters: |
+- zoom – Set the zoom expression. Default is 1.
+- x – Set the x expression. Default is 0.
+- y – Set the y expression. Default is 0.
+- d – Set the duration expression in number of frames. This sets for how many number of frames effect will last
+for single input image.
+- s – Set the output image size, default is
hd720 .
+- fps – Set the output frame rate, default is 25.
+- z – Alias for
zoom .
+
+ |
+
+
+
+Official documentation: zoompan
+
-
ffmpeg. file_input (filename)
-
+Input file URL (ffmpeg -i option)
+Official documentation: Main options
+
-
-
ffmpeg. file_output (parent, filename)
-
+ffmpeg. file_output (parent_node, filename)
+Output file URL
+Official documentation: Synopsis
+
+
+
+-
+
ffmpeg. input (filename)
+Shorthand for file_input
+
-
-
ffmpeg. merge_outputs (*parents)
+ffmpeg. merge_outputs (*parent_nodes)
+
+-
+
ffmpeg. output (parent_node, filename)
+Shorthand for file_output
+
+
-
-
ffmpeg. overwrite_output (parent)
-
+ffmpeg. overwrite_output (parent_node)
+Overwrite output files without asking (ffmpeg -y option)
+Official documentation: Main options
+
-
-
ffmpeg. get_args (parent)
-
+ffmpeg. get_args (node)
+Get command-line arguments for ffmpeg.
+
-
-
ffmpeg. run (parent, cmd=’ffmpeg’)
-
+ffmpeg. run (node, cmd=’ffmpeg’)
+Run ffmpeg on node graph.
+
diff --git a/doc/html/objects.inv b/doc/html/objects.inv
index 70a5c88..3152618 100644
Binary files a/doc/html/objects.inv and b/doc/html/objects.inv differ
diff --git a/doc/html/searchindex.js b/doc/html/searchindex.js
index 294eda3..9a7ecd1 100644
--- a/doc/html/searchindex.js
+++ b/doc/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({docnames:["index"],envversion:52,filenames:["index.rst"],objects:{"":{ffmpeg:[0,0,0,"-"]},ffmpeg:{colorchannelmixer:[0,1,1,""],concat:[0,1,1,""],drawbox:[0,1,1,""],file_input:[0,1,1,""],file_output:[0,1,1,""],get_args:[0,1,1,""],hflip:[0,1,1,""],hue:[0,1,1,""],merge_outputs:[0,1,1,""],overlay:[0,1,1,""],overwrite_output:[0,1,1,""],run:[0,1,1,""],setpts:[0,1,1,""],trim:[0,1,1,""],vflip:[0,1,1,""],zoompan:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"class":[],"function":[],adjust:0,arg:0,base:[],bind:[],channel:0,cmd:0,color:0,colorchannelmix:0,concat:0,correspond:[],decor:[],drawbox:0,eof_act:0,expr:0,file:[],file_input:0,file_output:0,filenam:0,filter:0,filternod:[],fixm:[],fluent:[],frame:0,from:[],get_arg:0,globalnod:[],height:0,hflip:0,hue:0,index:0,input:0,inputnod:[],instanc:[],kwarg:0,list:[],main_par:0,make:[],merge_output:0,method:[],mix:0,modul:0,name:[],node:[],node_class:[],none:0,object:[],oper:[],option:[],outputnod:[],overlai:0,overlay_par:0,overwrite_output:0,page:0,paramet:[],parent:0,repeat:0,run:0,search:0,set:[],setpt:0,show:[],specifi:[],thick:0,trim:0,vflip:0,video:0,width:0,zoompan:0},titles:["ffmpeg-python: Python bindings for FFmpeg"],titleterms:{bind:0,document:[],ffmpeg:0,indic:0,python:0,tabl:0,welcom:[]}})
\ No newline at end of file
+Search.setIndex({docnames:["index"],envversion:52,filenames:["index.rst"],objects:{"":{ffmpeg:[0,0,0,"-"]},ffmpeg:{colorchannelmixer:[0,1,1,""],concat:[0,1,1,""],drawbox:[0,1,1,""],file_input:[0,1,1,""],file_output:[0,1,1,""],get_args:[0,1,1,""],hflip:[0,1,1,""],hue:[0,1,1,""],input:[0,1,1,""],merge_outputs:[0,1,1,""],output:[0,1,1,""],overlay:[0,1,1,""],overwrite_output:[0,1,1,""],run:[0,1,1,""],setpts:[0,1,1,""],trim:[0,1,1,""],vflip:[0,1,1,""],zoompan:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":0,"default":0,For:0,PTS:0,The:0,accept:0,action:0,activ:0,adjust:0,after:0,alia:0,all:0,also:0,alwai:0,angl:0,anoth:0,appli:0,area:0,arg:0,argument:0,asetpt:0,ask:0,audio:0,author:0,automat:0,behavior:0,both:0,box:0,bright:0,chang:0,channel:0,check:0,cmd:0,codec:0,color:0,colorchannelmix:0,command:0,common:0,concat:0,concaten:0,configur:0,construct:0,contain:0,continu:0,convert:0,coordin:0,corner:0,correctli:0,correspond:0,degre:0,deprec:0,differ:0,disabl:0,displai:0,document:0,draw:0,drawbox:0,drop:0,durat:0,dure:0,each:0,edg:0,effect:0,encount:0,end:0,end_fram:0,end_pt:0,endal:0,eof:0,eof_act:0,eval:0,evalu:0,exactli:0,except:0,explicitli:0,expr:0,express:0,fail:0,file:0,file_input:0,file_output:0,filenam:0,filter:0,first:0,flip:0,follow:0,forc:0,format:0,fps:0,frame:0,gbrp:0,gener:0,get:0,get_arg:0,graph:0,handl:0,have:0,hd720:0,height:0,heigth:0,hflip:0,horizont:0,how:0,hue:0,huge:0,imag:0,immedi:0,includ:0,incom:0,index:0,init:0,initi:0,input:0,instead:0,interpret:0,invalid:0,invert:0,its:0,join:0,kept:0,kwarg:0,last:0,layout:0,left:0,line:0,longest:0,luma:0,main:0,main_parent_nod:0,mani:0,manual:0,maximum:0,mean:0,merge_output:0,mix:0,mode:0,modifi:0,modul:0,must:0,necessari:0,node:0,none:0,number:0,offici:0,onc:0,one:0,onli:0,option:0,other:0,output:0,over:0,overlai:0,overlaid:0,overlay_parent_nod:0,overwrit:0,overwrite_output:0,pack:0,pad:0,page:0,pan:0,paramet:0,parent_nod:0,pass:0,pixel:0,planar:0,preced:0,present:0,process:0,radian:0,rang:0,rate:0,reason:0,relat:0,repeat:0,repeatlast:0,resolut:0,result:0,rgb:0,run:0,same:0,sampl:0,satur:0,search:0,second:0,secondari:0,section:0,segment:0,select:0,set:0,setpt:0,shorter:0,shortest:0,shorthand:0,should:0,silenc:0,singl:0,size:0,sloppi:0,space:0,special:0,specifi:0,start:0,start_fram:0,start_pt:0,stream:0,subpart:0,sure:0,synchron:0,synopsi:0,syntax:0,system:0,take:0,termin:0,them:0,thi:0,thick:0,through:0,time:0,timebas:0,timestamp:0,togeth:0,top:0,track:0,trim:0,type:0,unit:0,unsaf:0,until:0,url:0,use:0,used:0,user:0,util:0,valu:0,variabl:0,variou:0,vertic:0,vflip:0,video:0,visibl:0,when:0,which:0,width:0,within:0,without:0,work:0,write:0,yuv420:0,yuv422:0,yuv444:0,zoom:0,zoompan:0},titles:["ffmpeg-python: Python bindings for FFmpeg"],titleterms:{bind:0,ffmpeg:0,indic:0,python:0,tabl:0}})
\ No newline at end of file
diff --git a/doc/src/conf.py b/doc/src/conf.py
index bf992da..421af01 100644
--- a/doc/src/conf.py
+++ b/doc/src/conf.py
@@ -30,7 +30,7 @@ sys.path.insert(0, os.path.abspath('../..'))
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
-extensions = ['sphinx.ext.autodoc']
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
diff --git a/ffmpeg/_ffmpeg.py b/ffmpeg/_ffmpeg.py
index fe7c8e4..0bf28be 100644
--- a/ffmpeg/_ffmpeg.py
+++ b/ffmpeg/_ffmpeg.py
@@ -8,27 +8,53 @@ from .nodes import (
def file_input(filename):
+ """Input file URL (ffmpeg ``-i`` option)
+
+ Official documentation: `Main options `__
+ """
return InputNode(file_input.__name__, filename=filename)
+def input(filename):
+ """Shorthand for ``file_input``"""
+ return file_input(filename)
+
+
@operator(node_classes={OutputNode, GlobalNode})
-def overwrite_output(parent):
- return GlobalNode(parent, overwrite_output.__name__)
+def overwrite_output(parent_node):
+ """Overwrite output files without asking (ffmpeg ``-y`` option)
+
+ Official documentation: `Main options `__
+ """
+ return GlobalNode(parent_node, overwrite_output.__name__)
@operator(node_classes={OutputNode})
-def merge_outputs(*parents):
- return OutputNode(parents, merge_outputs.__name__)
+def merge_outputs(*parent_nodes):
+ return OutputNode(parent_nodes, merge_outputs.__name__)
@operator(node_classes={InputNode, FilterNode})
-def file_output(parent, filename):
- return OutputNode([parent], file_output.__name__, filename=filename)
+def file_output(parent_node, filename):
+ """Output file URL
+
+ Official documentation: `Synopsis `__
+ """
+ return OutputNode([parent_node], file_output.__name__, filename=filename)
+
+
+@operator(node_classes={InputNode, FilterNode})
+def output(parent_node, filename):
+ """Shorthand for ``file_output``"""
+ return file_output(parent_node, filename)
+
__all__ = [
'file_input',
'file_output',
+ 'input',
'merge_outputs',
+ 'output',
'overwrite_output',
]
diff --git a/ffmpeg/_filters.py b/ffmpeg/_filters.py
index 437ab8b..a1fe867 100644
--- a/ffmpeg/_filters.py
+++ b/ffmpeg/_filters.py
@@ -5,64 +5,201 @@ from .nodes import (
@operator()
-def setpts(parent, expr):
- return FilterNode([parent], setpts.__name__, expr)
+def setpts(parent_node, expr):
+ """Change the PTS (presentation timestamp) of the input frames.
+
+ Args:
+ expr: The expression which is evaluated for each frame to construct its timestamp.
+
+ Official documentation: `setpts, asetpts `__
+ """
+ return FilterNode([parent_node], setpts.__name__, expr)
@operator()
-def trim(parent, **kwargs):
- return FilterNode([parent], trim.__name__, **kwargs)
+def trim(parent_node, **kwargs):
+ """Trim the input so that the output contains one continuous subpart of the input.
+
+ Args:
+ start: Specify the time of the start of the kept section, i.e. the frame with the timestamp start will be the
+ first frame in the output.
+ end: Specify the time of the first frame that will be dropped, i.e. the frame immediately preceding the one
+ with the timestamp end will be the last frame in the output.
+ start_pts: This is the same as start, except this option sets the start timestamp in timebase units instead of
+ seconds.
+ end_pts: This is the same as end, except this option sets the end timestamp in timebase units instead of
+ seconds.
+ duration: The maximum duration of the output in seconds.
+ start_frame: The number of the first frame that should be passed to the output.
+ end_frame: The number of the first frame that should be dropped.
+
+ Official documentation: `trim `__
+ """
+ return FilterNode([parent_node], trim.__name__, **kwargs)
@operator()
-def overlay(main_parent, overlay_parent, eof_action='repeat', **kwargs):
+def overlay(main_parent_node, overlay_parent_node, eof_action='repeat', **kwargs):
+ """Overlay one video on top of another.
+
+ Args:
+ x: Set the expression for the x coordinates of the overlaid video on the main video. Default value is 0. In
+ case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
+ within the output visible area).
+ y: Set the expression for the y coordinates of the overlaid video on the main video. Default value is 0. In
+ case the expression is invalid, it is set to a huge value (meaning that the overlay will not be displayed
+ within the output visible area).
+ eof_action: The action to take when EOF is encountered on the secondary input; it accepts one of the following
+ values:
+
+ * ``repeat``: Repeat the last frame (the default).
+ * ``endall``: End both streams.
+ * ``pass``: Pass the main input through.
+
+ eval: Set when the expressions for x, and y are evaluated.
+ It accepts the following values:
+
+ * ``init``: only evaluate expressions once during the filter initialization or when a command is
+ processed
+ * ``frame``: evaluate expressions for each incoming frame
+
+ Default value is ``frame``.
+ shortest: If set to 1, force the output to terminate when the shortest input terminates. Default value is 0.
+ format: Set the format for the output video.
+ It accepts the following values:
+
+ * ``yuv420``: force YUV420 output
+ * ``yuv422``: force YUV422 output
+ * ``yuv444``: force YUV444 output
+ * ``rgb``: force packed RGB output
+ * ``gbrp``: force planar RGB output
+
+ Default value is ``yuv420``.
+ rgb (deprecated): If set to 1, force the filter to accept inputs in the RGB color space. Default value is 0.
+ This option is deprecated, use format instead.
+ repeatlast: If set to 1, force the filter to draw the last overlay frame over the main input until the end of
+ the stream. A value of 0 disables this behavior. Default value is 1.
+
+ Official documentation: `overlay `__
+ """
kwargs['eof_action'] = eof_action
- return FilterNode([main_parent, overlay_parent], overlay.__name__, **kwargs)
+ return FilterNode([main_parent_node, overlay_parent_node], overlay.__name__, **kwargs)
@operator()
-def hflip(parent):
- return FilterNode([parent], hflip.__name__)
+def hflip(parent_node):
+ """Flip the input video horizontally.
+
+ Official documentation: `hflip `__
+ """
+ return FilterNode([parent_node], hflip.__name__)
@operator()
-def vflip(parent):
- return FilterNode([parent], vflip.__name__)
+def vflip(parent_node):
+ """Flip the input video vertically.
+
+ Official documentation: `vflip `__
+ """
+ return FilterNode([parent_node], vflip.__name__)
@operator()
-def drawbox(parent, x, y, width, height, color, thickness=None, **kwargs):
+def drawbox(parent_node, x, y, width, height, color, thickness=None, **kwargs):
+ """Draw a colored box on the input image.
+
+ Args:
+ x: The expression which specifies the top left corner x coordinate of the box. It defaults to 0.
+ y: The expression which specifies the top left corner y coordinate of the box. It defaults to 0.
+ width: Specify the width of the box; if 0 interpreted as the input width. It defaults to 0.
+ heigth: Specify the height of the box; if 0 interpreted as the input height. It defaults to 0.
+ color: Specify the color of the box to write. For the general syntax of this option, check the "Color" section
+ in the ffmpeg-utils manual. If the special value invert is used, the box edge color is the same as the
+ video with inverted luma.
+ thickness: The expression which sets the thickness of the box edge. Default value is 3.
+ w: Alias for ``width``.
+ h: Alias for ``height``.
+ c: Alias for ``color``.
+ t: Alias for ``thickness``.
+
+ Official documentation: `drawbox `__
+ """
if thickness:
kwargs['t'] = thickness
- return FilterNode([parent], drawbox.__name__, x, y, width, height, color, **kwargs)
+ return FilterNode([parent_node], drawbox.__name__, x, y, width, height, color, **kwargs)
@operator()
-def concat(*parents, **kwargs):
- kwargs['n'] = len(parents)
- return FilterNode(parents, concat.__name__, **kwargs)
+def concat(*parent_nodes, **kwargs):
+ """Concatenate audio and video streams, joining them together one after the other.
+
+ The filter works on segments of synchronized video and audio streams. All segments must have the same number of
+ streams of each type, and that will also be the number of streams at output.
+
+ Args:
+ unsafe: Activate unsafe mode: do not fail if segments have a different format.
+
+ Related streams do not always have exactly the same duration, for various reasons including codec frame size or
+ sloppy authoring. For that reason, related synchronized streams (e.g. a video and its audio track) should be
+ concatenated at once. The concat filter will use the duration of the longest stream in each segment (except the
+ last one), and if necessary pad shorter audio streams with silence.
+
+ For this filter to work correctly, all segments must start at timestamp 0.
+
+ All corresponding streams must have the same parameters in all segments; the filtering system will automatically
+ select a common pixel format for video streams, and a common sample format, sample rate and channel layout for
+ audio streams, but other settings, such as resolution, must be converted explicitly by the user.
+
+ Different frame rates are acceptable but will result in variable frame rate at output; be sure to configure the
+ output file to handle it.
+
+ Official documentation: `concat `__
+ """
+ kwargs['n'] = len(parent_nodes)
+ return FilterNode(parent_nodes, concat.__name__, **kwargs)
@operator()
-def zoompan(parent, **kwargs):
- return FilterNode([parent], zoompan.__name__, **kwargs)
+def zoompan(parent_node, **kwargs):
+ """Apply Zoom & Pan effect.
+
+ Args:
+ zoom: Set the zoom expression. Default is 1.
+ x: Set the x expression. Default is 0.
+ y: Set the y expression. Default is 0.
+ d: Set the duration expression in number of frames. This sets for how many number of frames effect will last
+ for single input image.
+ s: Set the output image size, default is ``hd720``.
+ fps: Set the output frame rate, default is 25.
+ z: Alias for ``zoom``.
+
+ Official documentation: `zoompan `__
+ """
+ return FilterNode([parent_node], zoompan.__name__, **kwargs)
@operator()
-def hue(parent, **kwargs):
- return FilterNode([parent], hue.__name__, **kwargs)
+def hue(parent_node, **kwargs):
+ """Modify the hue and/or the saturation of the input.
+
+ Args:
+ h: Specify the hue angle as a number of degrees. It accepts an expression, and defaults to "0".
+ s: Specify the saturation in the [-10,10] range. It accepts an expression and defaults to "1".
+ H: Specify the hue angle as a number of radians. It accepts an expression, and defaults to "0".
+ b: Specify the brightness in the [-10,10] range. It accepts an expression and defaults to "0".
+
+ Official documentation: `hue `__
+ """
+ return FilterNode([parent_node], hue.__name__, **kwargs)
@operator()
-def colorchannelmixer(parent, *args, **kwargs):
+def colorchannelmixer(parent_node, *args, **kwargs):
"""Adjust video input frames by re-mixing color channels.
- `FFmpeg colorchannelmixer filter`_
-
- .. _FFmpeg colorchannelmixer filter:
- https://ffmpeg.org/ffmpeg-filters.html#toc-colorchannelmixer
+ Official documentation: `colorchannelmixer `__
"""
- return FilterNode([parent], colorchannelmixer.__name__, **kwargs)
+ return FilterNode([parent_node], colorchannelmixer.__name__, **kwargs)
__all__ = [
diff --git a/ffmpeg/_run.py b/ffmpeg/_run.py
index 501f1af..e6a8313 100644
--- a/ffmpeg/_run.py
+++ b/ffmpeg/_run.py
@@ -81,10 +81,11 @@ def _get_output_args(node, stream_name_map):
@operator(node_classes={OutputNode, GlobalNode})
-def get_args(parent):
+def get_args(node):
+ """Get command-line arguments for ffmpeg."""
args = []
# TODO: group nodes together, e.g. `-i somefile -r somerate`.
- sorted_nodes, child_map = _topo_sort(parent)
+ sorted_nodes, child_map = _topo_sort(node)
input_nodes = [node for node in sorted_nodes if isinstance(node, InputNode)]
output_nodes = [node for node in sorted_nodes if isinstance(node, OutputNode) and not
isinstance(node, GlobalNode)]
@@ -101,8 +102,9 @@ def get_args(parent):
@operator(node_classes={OutputNode, GlobalNode})
-def run(parent, cmd='ffmpeg'):
- args = [cmd] + parent.get_args()
+def run(node, cmd='ffmpeg'):
+ """Run ffmpeg on node graph."""
+ args = [cmd] + node.get_args()
_subprocess.check_call(args)
|