Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 02d08e4

Browse files
committed
ver 2.0
revise the readme.
1 parent d781dee commit 02d08e4

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

‎README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@
1313

1414
This is a mpegcoder adapted from FFmpeg & Python-c-api.Using it you could get access to processing video easily. Just use it as a common module in python like this.
1515

16-
```python
16+
```python
1717
import mpegCoder
18-
```
18+
```
1919

2020
Noted that this API need you to install numpy.
2121

2222
An example of decoding a video in an arbitrary format:
2323

24-
```python
24+
```python
2525
d = mpegCoder.MpegDecoder()
2626
d.FFmpegSetup(b'inputVideo.mp4')
2727
p = d.ExtractGOP(10) # Get a gop of current video by setting the start position of 10th frame.
2828
p = d.ExtractGOP() # Get a gop of current video, using the current position after the last ExtractGOP.
2929
d.ExtractFrame(100, 100) # Extract 100 frames from the begining of 100th frame.
30-
```
30+
```
3131

3232
An example of transfer the coding of a video with an assigned codec:
3333

34-
```python
34+
```python
3535
d = mpegCoder.MpegDecoder()
3636
d.FFmpegSetup(b'i.avi')
3737
e = mpegCoder.MpegEncoder()
@@ -45,11 +45,11 @@ An example of transfer the coding of a video with an assigned codec:
4545
e.EncodeFrame(i) # Encode current frame.
4646
e.FFmpegClose() # End encoding, and flush all frames in cache.
4747
d.clear() # Close the input video.
48-
```
48+
```
4949

5050
An example of demuxing the video streamer from a server:
5151

52-
```python
52+
```python
5353
d = mpegCoder.MpegClient() # create the handle
5454
d.setParameter(dstFrameRate=(5,1), readSize=5, cacheSize=12) # normalize the frame rate to 5 FPS, and use a cache which size is 12 frames. Read 5 frames each time.
5555
success = d.FFmpegSetup(b'rtsp://localhost:8554/video')
@@ -62,7 +62,9 @@ An example of demuxing the video streamer from a server:
6262
# do some processing
6363
d.terminate() # shut down the current thread. You could call start() and let it restart.
6464
d.clear() # Disconnect with the stream.
65-
```
65+
```
66+
67+
You could also find some more explanations in two examples about `MpegClient` in [here][exp1] and [here][exp2].
6668

6769
For more instructions, you could tap `help(mpegCoder)`.
6870

@@ -153,3 +155,6 @@ If you want, you could install `ffmpeg` on Linux: Here are some instructions
153155
* libavutil.so.56.5.100
154156
* libswresample.so.3.0.101
155157
* libswscale.so.5.0.101
158+
159+
[exp1]:https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python/tree/example-client-check "check the client"
160+
[exp2]:https://github.com/cainmagi/FFmpeg-Encoder-Decoder-for-Python/tree/example-client-player "client with player"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /