Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated installion section #1787

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion av/about.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "14.1.0"
__version__ = "14.2.0rc1"
11 changes: 4 additions & 7 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
BUILDDIR = _build
PYAV_PIP ?= pip
PIP := $(PYAV_PIP)
Expand All @@ -17,15 +16,13 @@ _build/rst/%.rst: %.py $(TAGFILE) $(shell find ../include ../av -name '*.pyx' -o
python $< > [email protected]
mv [email protected] $@

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
Expand Down
42 changes: 38 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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:
Expand All @@ -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,
}
57 changes: 0 additions & 57 deletions docs/overview/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,63 +21,6 @@ Another way to install PyAV is via `conda-forge <https://conda-forge.github.io>`
See the `Conda quick install <https://conda.io/docs/install/quick.html>`_ 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 <https://ffmpeg.zeranoe.com/builds/>`_.

Unpack them somewhere (like ``C:\ffmpeg``), and then :ref:`tell PyAV where they are located <build_on_windows>`.


Building from the latest source
-------------------------------

Expand Down
Loading