Skip to content

Commit a89627b

Browse files
committed
docs update
1 parent 4783195 commit a89627b

1 file changed

Lines changed: 127 additions & 11 deletions

File tree

src/ffmpegio/caps.py

Lines changed: 127 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,25 @@ def colors():
580580
return data
581581

582582

583-
# // according to fftools/comdutils.c show_help_demuxer()
583+
def demuxer_info(name):
584+
"""get detailed info of a media demuxer
584585
586+
:return: list of features
587+
:rtype: dict
585588
586-
def demuxer_info(name):
589+
The returned dict has following entries:
590+
591+
============== ========= ================================================
592+
Key type description
593+
============== ========= ================================================
594+
names list(str) List of compatible short names
595+
long_name str Common long name
596+
extensions list(str) List of associated common extensions (w/out '.')
597+
options str Unparsed string, listing supported options
598+
============== ========= ================================================
599+
"""
600+
601+
# // according to fftools/comdutils.c show_help_demuxer()
587602
stdout, data = __("demuxer", name)
588603
if data:
589604
return data
@@ -606,10 +621,30 @@ def demuxer_info(name):
606621
return data
607622

608623

609-
# // according to fftools/comdutils.c show_help_muxer()
624+
def muxer_info(name):
625+
"""get detailed info of a media muxer
610626
627+
:return: list of features
628+
:rtype: dict
629+
630+
The returned dict has following entries:
631+
632+
=============== ========= ================================================
633+
Key type description
634+
=============== ========= ================================================
635+
names list(str) List of compatible short names
636+
long_name str Common long name
637+
extensions list(str) List of associated common extensions (w/out '.')
638+
mime_types list(str) List of associated MIME types
639+
video_codecs list(str) List of supported video codecs
640+
audio_codecs list(str) List of supported audio codecs
641+
subtitle_codecs list(str) List of supported subtitle codecs
642+
options str Unparsed string, listing supported options
643+
=============== ========= ================================================
644+
"""
645+
646+
# // according to fftools/comdutils.c show_help_muxer()
611647

612-
def muxer_info(name):
613648
stdout, data = __("muxer", name)
614649
if data:
615650
return data
@@ -635,14 +670,57 @@ def muxer_info(name):
635670
return data
636671

637672

638-
# // according to fftools/comdutils.c show_help_codec()
673+
def encoder_info(name):
674+
"""get detailed info of an encoder
639675
676+
:return: list of features
677+
:rtype: dict
640678
641-
def encoder_info(name):
679+
The returned dict has following entries:
680+
681+
====================== ============== ================================================
682+
Key type description
683+
====================== ============== ================================================
684+
name list(str) Short names
685+
long_name str Long name
686+
capabilities list(str) List of supported capabilities
687+
threading list(str) List of threading capabilities
688+
supported_hwdevices list(str) List of supported hardware accelerators
689+
supported_framerates list(Fraction) List of supported video frame rates
690+
supported_pix_fmts list(str) List of supported video pixel formats
691+
supported_sample_rates list(int) List of supported audio sample rates
692+
supported_sample_fmts list(str) List of supported audio sample formats
693+
supported_layouts list(str) List of supported audio channel layouts
694+
options str Unparsed string, listing supported options
695+
====================== ============== ================================================
696+
"""
642697
return _getCodecInfo(name, True)
643698

644699

645700
def decoder_info(name):
701+
"""get detailed info of a decoder
702+
703+
:return: list of features
704+
:rtype: dict
705+
706+
The returned dict has following entries:
707+
708+
====================== ============== ================================================
709+
Key type description
710+
====================== ============== ================================================
711+
name list(str) Short names
712+
long_name str Long name
713+
capabilities list(str) List of supported capabilities
714+
threading list(str) List of threading capabilities
715+
supported_hwdevices list(str) List of supported hardware accelerators
716+
supported_framerates list(Fraction) List of supported video frame rates
717+
supported_pix_fmts list(str) List of supported video pixel formats
718+
supported_sample_rates list(int) List of supported audio sample rates
719+
supported_sample_fmts list(str) List of supported audio sample formats
720+
supported_layouts list(str) List of supported audio channel layouts
721+
options str Unparsed string, listing supported options
722+
====================== ============== ================================================
723+
"""
646724
return _getCodecInfo(name, False)
647725

648726

@@ -653,6 +731,7 @@ def decoder_info(name):
653731

654732

655733
def _getCodecInfo(name, encoder):
734+
# // according to fftools/comdutils.c show_help_codec()
656735
stdout, data = __("encoder" if encoder else "decoder", name)
657736
if data:
658737
return data
@@ -697,10 +776,31 @@ def resolveFs(s):
697776
return data
698777

699778

700-
# // according to fftools/comdutils.c show_help_filter()
779+
def filter_info(name):
780+
"""get detailed info of a filter
701781
782+
:return: list of features
783+
:rtype: dict
702784
703-
def filter_info(name):
785+
The returned dict has following entries:
786+
787+
=========== ============== ================================================
788+
Key type description
789+
=========== ============== ================================================
790+
name str Name
791+
description str Description
792+
threading list(str) List of threading capabilities
793+
inputs list(dict)|str List of input pads or 'dynamic' if variable
794+
outputs list(dict)|str List of output pads or 'dynamic' if variable
795+
options str Unparsed string, listing supported options
796+
=========== ============== ================================================
797+
798+
The dict iterms of 'inputs' and 'outputs' entries has two keys: 'name' and 'type'
799+
defining the pad name and pad stream type ('audio' or 'video')
800+
801+
"""
802+
803+
# // according to fftools/comdutils.c show_help_filter()
704804
stdout, data = __("filter", name)
705805
if data:
706806
return data
@@ -730,10 +830,25 @@ def filter_info(name):
730830
return data
731831

732832

733-
# // according to fftools/comdutils.c show_help_bsf()
833+
def bsfilter_info(name):
834+
"""get detailed info of a bitstream filter
734835
836+
:return: list of features
837+
:rtype: dict
735838
736-
def bsfilter_info(name):
839+
The returned dict has following entries:
840+
841+
================ ============== ================================================
842+
Key type description
843+
================ ============== ================================================
844+
name str Name
845+
supported_codecs str List of supported codecs
846+
options str Unparsed string, listing supported options
847+
================ ============== ================================================
848+
849+
"""
850+
851+
# // according to fftools/comdutils.c show_help_bsf()
737852
stdout, data = __("bsf", name)
738853
if data:
739854
return data
@@ -770,7 +885,7 @@ def _getFilterPortInfo(str):
770885
raise Exception("Failed to parse filter port info: %s" % str)
771886
return [{"name": m[1], "type": m[2]} for m in matches]
772887

773-
888+
#:dict: list of video size presets with their sizes
774889
video_size_presets = {
775890
"ntsc": (720, 480),
776891
"pal": (720, 576),
@@ -827,6 +942,7 @@ def _getFilterPortInfo(str):
827942
"uhd4320": (7680, 4320),
828943
}
829944

945+
#:dict: list of video frame rate presets with their rates
830946
frame_rate_presets = {
831947
"ntsc": fractions.Fraction(30000, 1001),
832948
"pal": fractions.Fraction(25, 1),

0 commit comments

Comments
 (0)