diff --git a/av/about.py b/av/about.py index 217fb25cb..4c6a9313e 100644 --- a/av/about.py +++ b/av/about.py @@ -1 +1 @@ -__version__ = "14.1.0" +__version__ = "14.2.0rc1" diff --git a/docs/Makefile b/docs/Makefile index 7efd36bac..e45e1d03a 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,5 +1,4 @@ SPHINXOPTS = -SPHINXBUILD = sphinx-build BUILDDIR = _build PYAV_PIP ?= pip PIP := $(PYAV_PIP) @@ -17,15 +16,13 @@ _build/rst/%.rst: %.py $(TAGFILE) $(shell find ../include ../av -name '*.pyx' -o python $< > $@.tmp mv $@.tmp $@ -clean: - rm -rf $(BUILDDIR) $(FFMPEGDIR) - -html: $(RENDERED) $(TAGFILE) +html: $(RENDERED) $(PIP) install -U sphinx - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + rm -rf $(BUILDDIR) + sphinx-build -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html test: - PYAV_SKIP_DOXYLINK=1 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + PYAV_SKIP_DOXYLINK=1 sphinx-build -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest open: open _build/html/index.html diff --git a/docs/conf.py b/docs/conf.py index 1f2541f32..b88dc7bd3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -88,7 +88,6 @@ def sandboxed(*args, **kwargs): doctest_test_doctest_blocks = "" extlinks = { - "ffmpeg": ("https://ffmpeg.org/doxygen/trunk/%s.html", "%s"), "ffstruct": ("https://ffmpeg.org/doxygen/trunk/struct%s.html", "struct %s"), "issue": ("https://github.com/PyAV-Org/PyAV/issues/%s", "#%s"), "pr": ("https://github.com/PyAV-Org/PyAV/pull/%s", "#%s"), @@ -203,9 +202,7 @@ def makerow(*texts): seen = set() enum_items = [ - (name, item) - for name, item in vars(enum).items() - if isinstance(item, enum) + (name, item) for name, item in vars(enum).items() if isinstance(item, enum) ] for name, item in enum_items: if name.lower() in seen: @@ -226,8 +223,45 @@ def makerow(*texts): return [table] +def ffmpeg_role(name, rawtext, text, lineno, inliner, options={}, content=[]): + """ + Custom role for FFmpeg API links. + Converts :ffmpeg:`AVSomething` into proper FFmpeg API documentation links. + """ + + base_url = "https://ffmpeg.org/doxygen/7.0/struct{}.html" + + try: + struct_name, member = text.split(".") + except Exception: + struct_name = None + + if struct_name is None: + url = base_url.format(text) + else: + fragment = { + "AVCodecContext.thread_count": "#aa852b6227d0778b62e9cc4034ad3720c", + "AVCodecContext.thread_type": "#a7651614f4309122981d70e06a4b42fcb", + "AVCodecContext.skip_frame": "#af869b808363998c80adf7df6a944a5a6", + "AVCodec.capabilities": "#af51f7ff3dac8b730f46b9713e49a2518", + "AVCodecDescriptor.props": "#a9949288403a12812cd6e3892ac45f40f", + }.get(text, f"#{member}") + + url = base_url.format(struct_name) + fragment + + node = nodes.reference(rawtext, text, refuri=url, **options) + return [node], [] + + def setup(app): app.add_css_file("custom.css") + app.add_role("ffmpeg", ffmpeg_role) app.add_directive("flagtable", EnumTable) app.add_directive("enumtable", EnumTable) app.add_directive("pyinclude", PyInclude) + + return { + "version": "1.0", + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/docs/overview/installation.rst b/docs/overview/installation.rst index cf1364c1a..eea041203 100644 --- a/docs/overview/installation.rst +++ b/docs/overview/installation.rst @@ -21,63 +21,6 @@ Another way to install PyAV is via `conda-forge ` See the `Conda quick install `_ docs to get started with (mini)Conda. -Bring your own FFmpeg ---------------------- - -PyAV can also be compiled against your own build of FFmpeg (version ``7.0`` or higher). You can force installing PyAV from source by running: - -.. code-block:: bash - - pip install av --no-binary av - -PyAV depends upon several libraries from FFmpeg: - -- ``libavcodec`` -- ``libavdevice`` -- ``libavfilter`` -- ``libavformat`` -- ``libavutil`` -- ``libswresample`` -- ``libswscale`` - -and a few other tools in general: - -- ``pkg-config`` -- Python's development headers - - -MacOS -^^^^^ - -On **MacOS**, Homebrew_ saves the day:: - - brew install ffmpeg pkg-config - -.. _homebrew: http://brew.sh/ - - -Ubuntu >= 18.04 LTS -^^^^^^^^^^^^^^^^^^^ - -On **Ubuntu 18.04 LTS** everything can come from the default sources:: - - # General dependencies - sudo apt-get install -y python-dev pkg-config - - # Library components - sudo apt-get install -y \ - libavformat-dev libavcodec-dev libavdevice-dev \ - libavutil-dev libswscale-dev libswresample-dev libavfilter-dev - - -Windows -^^^^^^^ - -It is possible to build PyAV on Windows without Conda by installing FFmpeg yourself, e.g. from the `shared and dev packages `_. - -Unpack them somewhere (like ``C:\ffmpeg``), and then :ref:`tell PyAV where they are located `. - - Building from the latest source -------------------------------