@@ -12,7 +12,7 @@ There are tons of Python FFmpeg wrappers out there but they seem to lack complex
1212## Quickstart
1313
1414Flip a video horizontally:
15- ```
15+ ``` python
1616import ffmpeg
1717stream = ffmpeg.input(' input.mp4' )
1818stream = ffmpeg.hflip(stream)
@@ -21,7 +21,7 @@ ffmpeg.run(stream)
2121```
2222
2323Or if you prefer a fluent interface:
24- ```
24+ ``` python
2525import ffmpeg
2626(ffmpeg
2727 .input(' input.mp4' )
@@ -39,7 +39,7 @@ Take for example a signal graph that looks like this:
3939![ Signal graph] ( https://raw.githubusercontent.com/kkroening/ffmpeg-python/master/doc/graph1.png )
4040
4141The corresponding command-line arguments are pretty gnarly:
42- ```
42+ ``` bash
4343ffmpeg -i input.mp4 \
4444 -filter_complex " \
4545 [0]trim=start_frame=10:end_frame=20[v0];\
@@ -54,7 +54,7 @@ ffmpeg -i input.mp4 \
5454Maybe this looks great to you, but if you're not an FFmpeg command-line expert, it probably looks alien.
5555
5656If you're like me and find Python to be powerful and readable, it's easy with ` ffmpeg-python ` :
57- ```
57+ ``` python
5858import ffmpeg
5959
6060in_file = ffmpeg.input(' input.mp4' )
@@ -87,7 +87,7 @@ pip install ffmpeg-python
8787```
8888
8989It's also possible to clone the source and put it on your python path (` $PYTHONPATH ` , ` sys.path ` , etc.):
90- ```
90+ ``` bash
9191$ git clone
[email protected] :kkroening/ffmpeg-python.git
9292$ export PYTHONPATH=${PYTHONPATH} :ffmpeg-python
9393$ python
@@ -99,23 +99,23 @@ $ python
9999API documentation is automatically generated from python docstrings and hosted on github pages: https://kkroening.github.io/ffmpeg-python/
100100
101101Alternatively, standard python help is available, such as at the python REPL prompt as follows:
102- ```
102+ ``` python
103103>> > import ffmpeg
104104>> > help (ffmpeg)
105105```
106106
107107## Custom Filters
108108
109109Don'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
111111stream = ffmpeg.input(' dummy.mp4' )
112112stream = ffmpeg.filter_(stream, ' fps' , fps = 25 , round = ' up' )
113113stream = ffmpeg.output(stream, ' dummy2.mp4' )
114114ffmpeg.run(stream)
115115```
116116
117117Or fluently:
118- ```
118+ ``` python
119119(ffmpeg
120120 .input(' dummy.mp4' )
121121 .filter_(' fps' , fps = 25 , round = ' up' )
0 commit comments