@@ -12,7 +12,7 @@ There are tons of Python FFmpeg wrappers out there but they seem to lack complex
12
12
## Quickstart
13
13
14
14
Flip a video horizontally:
15
- ```
15
+ ``` python
16
16
import ffmpeg
17
17
stream = ffmpeg.input(' input.mp4' )
18
18
stream = ffmpeg.hflip(stream)
@@ -21,7 +21,7 @@ ffmpeg.run(stream)
21
21
```
22
22
23
23
Or if you prefer a fluent interface:
24
- ```
24
+ ``` python
25
25
import ffmpeg
26
26
(ffmpeg
27
27
.input(' input.mp4' )
@@ -39,7 +39,7 @@ Take for example a signal graph that looks like this:
39
39
![ Signal graph] ( https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/doc/graph1.png )
40
40
41
41
The corresponding command-line arguments are pretty gnarly:
42
- ```
42
+ ``` bash
43
43
ffmpeg -i input.mp4 \
44
44
-filter_complex " \
45
45
[0]trim=start_frame=10:end_frame=20[v0];\
@@ -54,7 +54,7 @@ ffmpeg -i input.mp4 \
54
54
Maybe this looks great to you, but if you're not an FFmpeg command-line expert, it probably looks alien.
55
55
56
56
If you're like me and find Python to be powerful and readable, it's easy with ` ffmpeg-python ` :
57
- ```
57
+ ``` python
58
58
import ffmpeg
59
59
60
60
in_file = ffmpeg.input(' input.mp4' )
@@ -87,7 +87,7 @@ pip install ffmpeg-python
87
87
```
88
88
89
89
It's also possible to clone the source and put it on your python path (` $PYTHONPATH ` , ` sys.path ` , etc.):
90
- ```
90
+ ``` bash
91
91
$ git clone git@github.com:kkroening/ffmpeg-python.git
92
92
$ export PYTHONPATH=${PYTHONPATH} :ffmpeg-python
93
93
$ python
@@ -99,23 +99,23 @@ $ python
99
99
API documentation is automatically generated from python docstrings and hosted on github pages: https://kkroening.github.io/ffmpeg-python/
100
100
101
101
Alternatively, standard python help is available, such as at the python REPL prompt as follows:
102
- ```
102
+ ``` python
103
103
>> > import ffmpeg
104
104
>> > help (ffmpeg)
105
105
```
106
106
107
107
## Custom Filters
108
108
109
109
Don't see the filter you're looking for? ` ffmpeg-python ` is a work in progress, but it's easy to use any arbitrary ffmpeg filter:
110
- ```
110
+ ``` python
111
111
stream = ffmpeg.input(' dummy.mp4' )
112
112
stream = ffmpeg.filter_(stream, ' fps' , fps = 25 , round = ' up' )
113
113
stream = ffmpeg.output(stream, ' dummy2.mp4' )
114
114
ffmpeg.run(stream)
115
115
```
116
116
117
117
Or fluently:
118
517E
- ```
118
+ ``` python
119
119
(ffmpeg
120
120
.input(' dummy.mp4' )
121
121
.filter_(' fps' , fps = 25 , round = ' up' )
0 commit comments