8000 Update README.md · Powercoder64/ffmpeg-python@a1e1f30 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1e1f30

Browse files
authored
Update README.md
1 parent 2db3c4a commit a1e1f30

File tree

1 file changed

+49
-13
lines changed

1 file changed

+49
-13
lines changed

README.md

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,43 +130,71 @@ Or fluently:
130130
)
131131
```
132132

133-
Arguments with special names such as `-qscale:v` can be specified as a keyword-args dictionary as follows:
133+
**Special option names:**
134+
135+
Arguments with special names such as `-qscale:v` (variable bitrate), `-b:v` (constant bitrate), etc. can be specified as a keyword-args dictionary as follows:
134136
```python
135137
(
136138
ffmpeg
137-
.input('dummy.mp4')
138-
.output('dummy2.mp4', **{'qscale:v': 3})
139+
.input('in.mp4')
140+
.output('out.mp4', **{'qscale:v': 3})
139141
.run()
140142
)
141143
```
142144

143-
Filters that take multiple input streams can be specified by passing the input streams as an array to `ffmpeg.filter`:
145+
**Multiple inputs:**
146+
147+
Filters that take multiple input streams can be used by passing the input streams as an array to `ffmpeg.filter`:
144148
```python
145149
main = ffmpeg.input('main.mp4')
146150
logo = ffmpeg.input('logo.png')
147-
stream = (
151+
(
148152
ffmpeg
149153
.filter([main, logo], 'overlay', 10, 10)
150154
.output('out.mp4')
151155
.run()
152156
)
153157
```
154158

155-
When in doubt, refer to the [existing filters](https://github.com/kkroening/ffmpeg-python/blob/master/ffmpeg/_filters.py), [examples](https://github.com/kkroening/ffmpeg-python/tree/master/examples), and/or the [official ffmpeg documentation](https://ffmpeg.org/ffmpeg-filters.html).
159+
**Multiple outputs:**
156160

157-
## Frequently asked questions
161+
Filters that produce multiple outputs can be used with `.filter_multi_output`:
162+
```python
163+
split = (
164+
ffmpeg
165+
.input('in.mp4')
166+
.filter_multi_output('split') # or `.split()`
167+
)
168+
(
169+
ffmpeg
170+
.concat(split[0], split[1].reverse())
171+
.output('out.mp4')
172+
.run()
173+
)
174+
```
175+
(In this particular case, `.split()` is the equivalent shorthand, but the general approach works for other multi-output filters)
158176

159-
**Why do I get an import/attribute/etc. error from `import ffmpeg`?**
177+
**String expressions:**
160178

161-
Make sure you ran `pip install ffmpeg-python` and not `pip install ffmpeg` or `pip install python-ffmpeg`.
179+
Expressions to be interpreted by ffmpeg can be included as string parameters and reference any special ffmpeg variable names:
180+
```python
181+
(
182+
ffmpeg
183+
.input('in.mp4')
184+
.filter('crop', 'in_w-2*10', 'in_h-2*20')
185+
.input('out.mp4')
186+
)
187+
```
162188

163-
**How do I do XYZ?**
189+
<br />
164190

165-
Take a look at each of the links in the [Additional Resources](https://kkroening.github.io/ffmpeg-python/) section at the end of this README. If you look everywhere and can't find what you're looking for and have a question that may be relevant to other users, you may open an issue asking how to do it, while providing a thorough explanation of what you're trying to do and what you've tried so far.
191+
When in doubt, refer to the [existing filters](https://github.com/kkroening/ffmpeg-python/blob/master/ffmpeg/_filters.py), [examples](https://github.com/kkroening/ffmpeg-python/tree/master/examples), and/or the [official ffmpeg documentation](https://ffmpeg.org/ffmpeg-filters.html).
166192

167-
Issues not directly related to `ffmpeg-python` or issues asking others to write your code for you or how to do the work of solving a complex signal processing problem for you that's not relevant to other users will be closed.
193+
## Frequently asked questions
168194

169-
That said, we hope to continue improving our documentation and provide a community of support for people using `ffmpeg-python` to do cool and exciting things.
195+
**Why do I get an import/attribute/etc. error from `import ffmpeg`?**
196+
197+
Make sure you ran `pip install ffmpeg-python` and not `pip install ffmpeg` or `pip install python-ffmpeg`.
170198

171199
**Why did my audio stream get dropped?**
172200

@@ -176,6 +204,14 @@ This dilemma is intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the
176204

177205
As usual, take a look at the [examples](https://github.com/kkroening/ffmpeg-python/tree/master/examples#audiovideo-pipeline) (*Audio/video pipeline* in particular).
178206

207+
**How do I do XYZ?**
208+
209+
Take a look at each of the links in the [Additional Resources](https://kkroening.github.io/ffmpeg-python/) section at the end of this README. If you look everywhere and can't find what you're looking for and have a question that may be relevant to other users, you may open an issue asking how to do it, while providing a thorough explanation of what you're trying to do and what you've tried so far.
210+
211+
Issues not directly related to `ffmpeg-python` or issues asking others to write your code for you or how to do the work of solving a complex signal processing problem for you that's not relevant to other users will be closed.
212+
213+
That said, we hope to continue improving our documentation and provide a community of support for people using `ffmpeg-python` to do cool and exciting things.
214+
179215
## Contributing
180216

181217
<img align="right" src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/doc/logo.png" alt="ffmpeg-python logo" width="20%" />

0 commit comments

Comments
 (0)
0