14
14
.. |github-status | image :: https://img.shields.io/github/workflow/status/python-ffmpegio/python-ffmpeg-downloader/Run%20Tests
15
15
:alt: GitHub Workflow Status
16
16
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:
20
20
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:
22
28
23
29
======= ==========================================================================
24
30
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>`_
28
34
29
35
If you appreciate their effort to build and host these builds, please consider donating on their websites.
30
36
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
-
34
37
Installation
35
38
------------
36
39
@@ -41,31 +44,96 @@ Installation
41
44
Console Commands
42
45
----------------
43
46
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
+
44
54
To download and install FFmpeg binaries
45
55
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46
56
47
57
.. code-block :: bash
48
58
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:\U sers\U ser\A ppData\L ocal\f fmpegio\f fmpeg-downloader\f fmpeg\b in
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
50
90
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 ``@ ``
53
111
54
112
.. code-block :: bash
55
113
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
57
125
58
126
To uninstall
59
127
^^^^^^^^^^^^
60
128
61
129
.. code-block :: bash
62
130
63
- python -m ffmpeg_downloader --remove
131
+ ffdl uninstall
64
132
65
133
In Python
66
134
---------
67
135
68
- This package exposes the following 4 attributes:
136
+ This package has the following useful attributes:
69
137
70
138
.. code-block :: python
71
139
@@ -75,3 +143,19 @@ This package exposes the following 4 attributes:
75
143
ffdl.ffmpeg_version # version string of the intalled FFmpeg
76
144
ffdl.ffmpeg_path # full path of the FFmpeg binary
77
145
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