Skip to content

Commit 718ecc8

Browse files
committed
doc update
1 parent cce9cd0 commit 718ecc8

File tree

1 file changed

+97
-13
lines changed

1 file changed

+97
-13
lines changed

README.rst

Lines changed: 97 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414
.. |github-status| image:: https://img.shields.io/github/workflow/status/python-ffmpegio/python-ffmpeg-downloader/Run%20Tests
1515
:alt: GitHub Workflow Status
1616

17-
Python `ffmpeg-downloader` package automatically downloads the latest FFmpeg release binaries for Windows, Linux, & MacOS. Note
18-
while it supports Linux and MacOS, it is intended for Windows users, for whom there is no installer is currently
19-
available. Linux and MacOS users are encouraged to install via the OS package manager (e.g., `apt-get` for Ubuntu and `brew` for MacOS).
17+
Python `ffmpeg-downloader` package automatically downloads the latest FFmpeg prebuilt binaries for Windows, Linux, & MacOS.
18+
It's cli interface mimics that of `pip` to install, uninstall, list, search, and download available FFmpeg versions. This package
19+
is ideal for those who:
2020

21-
The FFmpeg release builds are downloaded from 3rd party hosts:
21+
- Use the git snapshot version of FFmpeg
22+
- Are in Windows environment
23+
24+
Those who intend to use a release version in Linux and MacOS are encouraged to install via the OS package manager
25+
(e.g., `apt-get` for Ubuntu and `brew` for MacOS).
26+
27+
The FFmpeg builds will be downloaded from 3rd party hosts:
2228

2329
======= ==========================================================================
2430
Windows `https://www.gyan.dev/ffmpeg/builds <https://www.gyan.dev/ffmpeg/builds>`_
@@ -28,9 +34,6 @@ MacOS `https://evermeet.cx/ffmpeg <https://evermeet.cx/ffmpeg>`_
2834

2935
If you appreciate their effort to build and host these builds, please consider donating on their websites.
3036

31-
This package is used in `ffmpegio-plugin-downloader <https://github.com/python-ffmpegio/python-ffmpegio-plugin-downloader>`__
32-
to enable automatic detection of the FFmpeg executable.
33-
3437
Installation
3538
------------
3639

@@ -41,31 +44,96 @@ Installation
4144
Console Commands
4245
----------------
4346

47+
In cli, use `ffdl` command after the package is installed. Alternately, you can call the module by
48+
`python -m ffmpeg_downloader`. For full help, run:
49+
50+
.. code-block::
51+
52+
ffdl -h <command>
53+
4454
To download and install FFmpeg binaries
4555
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4656

4757
.. code-block:: bash
4858
49-
python -m ffmpeg_downloader
59+
ffdl install
60+
61+
This command downloads and installs the latest FFmpeg **release**. You will see the progress messages
62+
similar to the following:
63+
64+
.. code-block:: bash
65+
66+
Collecting ffmpeg
67+
Using cached ffmpeg-5.1.2-essentials_build.zip (79 MB)
68+
Installing collected FFmpeg binaries: 5.1.2@essentials
69+
Successfully installed FFmpeg binaries: 5.1.2@essentials in
70+
C:\Users\User\AppData\Local\ffmpegio\ffmpeg-downloader\ffmpeg\bin
71+
72+
In Linux, symlinks fo the installed binaries are automatically created in `~/.local/bin` or `~/bin`
73+
so the FFmpeg commands are immediately available (only if one of these directories already exists).
74+
75+
In Windows and MacOS, the binary folder can be added to the system path by `--add-path` option:
76+
77+
.. code-block:: bash
78+
79+
ffdl install --add-path
80+
81+
The new system paths won't be applied to the current console window. You may need to close and reopen
82+
or possibly log out and log back in for the change to take effect.
83+
84+
To install the latest git snapshot (master) build:
85+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86+
87+
.. code-block:: bash
88+
89+
ffdl install snapshot
5090
51-
To check for a newer release and update if available
52-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91+
To specify a release version:
92+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93+
94+
Add version number as the last argument of the command:
95+
96+
.. code-block:: bash
97+
98+
ffdl install 4.4
99+
100+
Additionally, there are multiple options for each build for the Windows builds:
101+
102+
=============== ===========================================================================
103+
``essentials`` Built only with commonly used third-party libraries (default option)
104+
``full`` Built with the most third-party libraries
105+
``full-shared`` Same as ``full`` but separate shared libraries (DLLs) and development files
106+
(release builds only)
107+
=============== ===========================================================================
108+
109+
See `gyan.dev<https://www.gyan.dev/ffmpeg/builds/#about-these-builds>`_ for more information.
110+
To specify which flavor to install, use ``@``
53111

54112
.. code-block:: bash
55113
56-
python -m ffmpeg_downloader --update
114+
ffdl install snapshot@full # full build of latest snapshot
115+
ffdl install 5.2@full-shared # full build of v5.2
116+
117+
To update or change version if available
118+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119+
120+
Like ``pip``, use ``-U`` or ``--upgrade`` flag
121+
122+
.. code-block:: bash
123+
124+
ffdl install -U
57125
58126
To uninstall
59127
^^^^^^^^^^^^
60128

61129
.. code-block:: bash
62130
63-
python -m ffmpeg_downloader --remove
131+
ffdl uninstall
64132
65133
In Python
66134
---------
67135

68-
This package exposes the following 4 attributes:
136+
This package has the following useful attributes:
69137

70138
.. code-block:: python
71139
@@ -75,3 +143,19 @@ This package exposes the following 4 attributes:
75143
ffdl.ffmpeg_version # version string of the intalled FFmpeg
76144
ffdl.ffmpeg_path # full path of the FFmpeg binary
77145
ffdl.ffprobe_path # full path of the FFprobe binary
146+
ffdl.ffplay_path # full path of the FFplay binary
147+
148+
149+
The ``ffxxx_path`` attributes are useful to call FFxxx command with ``subprocess``:
150+
151+
.. code-block:: python
152+
153+
# To call FFmpeg via subprocess
154+
import subprocess as sp
155+
156+
sp.run([ffdl.ffmpeg_path, '-i', 'input.mp4', 'output.mkv'])
157+
158+
Meanwhile, there are many FFmpeg wrapper packages which do not let you specify the
159+
FFmpeg path or cumbersome to do so. If installing the FFmpeg with ``--add-path`` option is
160+
not preferable, use `ffmpeg_downloader.add_path()` function to make the binaries available
161+
to these packages.

0 commit comments

Comments
 (0)