8000 Merge remote-tracking branch 'origin/master' · monir-dev/ffmpeg-python@06d4a6f · GitHub
[go: up one dir, main page]

Skip to content

Commit 06d4a6f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 7d1ac28 + ce06215 commit 06d4a6f

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ ffmpeg.run(stream)
2323
Or if you prefer a fluent interface:
2424
```python
2525
import ffmpeg
26-
(ffmpeg
26+
(
27+
ffmpeg
2728
.input('input.mp4')
2829
.hflip()
2930
.output('output.mp4')
@@ -54,7 +55,8 @@ import ffmpeg
5455

5556
in_file = ffmpeg.input('input.mp4')
5657
overlay_file = ffmpeg.input('overlay.png')
57-
(ffmpeg
58+
(
59+
ffmpeg
5860
.concat(
5961
in_file.trim(start_frame=10, end_frame=20),
6062
in_file.trim(start_frame=30, end_frame=40),
@@ -117,7 +119,7 @@ Alternatively, standard python help is available, such as at the python REPL pro
117119

118120
## Custom Filters
119121

120-
Don't see the filter you're looking for? `ffmpeg-python` includes , but it's easy to use any arbitrary ffmpeg filter:
122+
Don't see the filter you're looking for? `ffmpeg-python` includes shorthand notation for some of the most commonly used filters (such as `concat`), but it's easy to use any arbitrary ffmpeg filter:
121123
```python
122124
stream = ffmpeg.input('dummy.mp4')
123125
stream = ffmpeg.filter_(stream, 'fps', fps=25, round='up')
@@ -127,7 +129,8 @@ ffmpeg.run(stream)
127129

128130
Or fluently:
129131
```python
130-
(ffmpeg
132+
(
133+
ffmpeg
131134
.input('dummy.mp4')
132135
.filter_('fps', fps=25, round='up')
133136
.output('dummy2.mp4')
@@ -137,7 +140,8 @@ Or fluently:
137140

138141
Arguments with special names such as `-qscale:v` can be specified as a keyword-args dictionary as follows:
139142
```python
140-
(ffmpeg
143+
(
144+
ffmpeg
141145
.input('dummy.mp4')
142146
.output('dummy2.mp4', **{'qscale:v': 3})
143147
.run()

examples/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Examples
22

3-
## [Get video info](https://github.com/kkroening/ffmpeg-python/blob/master/examples/video_info.py#L15)
3+
## [Get video info (ffprobe)](https://github.com/kkroening/ffmpeg-python/blob/master/examples/video_info.py#L15)
44

55
```python
66
probe = ffmpeg.probe(args.in_filename)
@@ -23,24 +23,6 @@ height = int(video_stream['height'])
2323
)
2424
```
2525

26-
## Process audio and video simultaneously
27-
28-
<img src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/examples/graphs/av-pipeline.png" alt="av-pipeline graph" width="80%" />
29-
30-
```python
31-
in1 = ffmpeg.input('in1.mp4')
32-
in2 = ffmpeg.input('in2.mp4')
33-
v1 = in1['v'].hflip()
34-
a1 = in1['a']
35-
v2 = in2['v'].filter_('reverse').filter_('hue', s=0)
36-
a2 = in2['a'].filter_('areverse').filter_('aphaser')
37-
joined = ffmpeg.concat(v1, a1, v2, a2, v=1, a=1).node
38-
v3 = joined[0]
39-
a3 = joined[1].filter_('volume', 0.8)
40-
out = ffmpeg.output(v3, a3, 'out.mp4')
41-
out.run()
42-
```
43-
4426
## [Convert video to numpy array](https://github.com/kkroening/ffmpeg-python/blob/master/examples/ffmpeg-numpy.ipynb)
4527

4628
<img src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/examples/graphs/ffmpeg-numpy.png" alt="ffmpeg-numpy graph" width="20%" />
@@ -86,6 +68,24 @@ out, _ = (ffmpeg
8668
)
8769
```
8870

71+
## Audio/video pipeline
AE9D 72+
73+
<img src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/examples/graphs/av-pipeline.png" alt="av-pipeline graph" width="80%" />
74+
75+
```python
76+
in1 = ffmpeg.input('in1.mp4')
77+
in2 = ffmpeg.input('in2.mp4')
78+
v1 = in1['v'].hflip()
79+
a1 = in1['a']
80+
v2 = in2['v'].filter_('reverse').filter_('hue', s=0)
81+
a2 = in2['a'].filter_('areverse').filter_('aphaser')
82+
joined = ffmpeg.concat(v1, a1, v2, a2, v=1, a=1).node
83+
v3 = joined[0]
84+
a3 = joined[1].filter_('volume', 0.8)
85+
out = ffmpeg.output(v3, a3, 'out.mp4')
86+
out.run()
87+
```
88+
8989
## [Jupyter Frame Viewer](https://github.com/kkroening/ffmpeg-python/blob/master/examples/ffmpeg-numpy.ipynb)
9090

9191
<img src="https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/doc/jupyter-screenshot.png" alt="jupyter screenshot" width="75%" />

0 commit comments

Comments
 (0)
0