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 d781dee

Browse files
committed
ver 2.0
revise the readme.
1 parent 883e76e commit d781dee

File tree

1 file changed

+49
-50
lines changed

1 file changed

+49
-50
lines changed

‎README.md

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# FFmpeg-Encoder-Decoder-for-Python
32

43
*****
@@ -14,9 +13,9 @@
1413

1514
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.
1615

17-
```python
18-
import mpegCoder
19-
```
16+
```python
17+
import mpegCoder
18+
```
2019

2120
Noted that this API need you to install numpy.
2221

@@ -71,86 +70,86 @@ For more instructions, you could tap `help(mpegCoder)`.
7170

7271
### V2.0 update report:
7372

74-
1. Revise the bug of the encoder which may cause the stream duration is shorter than the real duration of the video in some not advanced media players.
73+
1. Revise the bug of the encoder which may cause the stream duration is shorter than the real duration of the video in some not advanced media players.
7574

76-
2. Improve the structure of the code and remove some unnecessary codes.
75+
2. Improve the structure of the code and remove some unnecessary codes.
7776

78-
3. Provide a complete version of client, which could demux the video stream from a server in any network protocol.
77+
3. Provide a complete version of client, which could demux the video stream from a server in any network protocol.
7978

8079
### V1.8 update report:
8180

82-
1. Provide options (widthDst, heightDst) to let MpegDecoder could control the output size manually. To ensure the option is valid, we must use the method `setParameter` before `FFmpegSetup`. Now you could use this options to get a rescaled output directly:
81+
1. Provide options (widthDst, heightDst) to let MpegDecoder could control the output size manually. To ensure the option is valid, we must use the method `setParameter` before `FFmpegSetup`. Now you could use this options to get a rescaled output directly:
8382

84-
```python
85-
d = mpegCoder.MpegDecoder() # initialize
86-
d.setParameter(widthDst=400, heightDst=300) # noted that these options must be set before 'FFmpegSetup'!
87-
d.FFmpegSetup(b'i.avi') # the original video size would not influence the output
88-
print(d) # examine the parameters. You could also get the original video size by 'getParameter'
89-
d.ExtractFrame(0, 100) # get 100 frames with 400x300
90-
```
83+
```python
84+
d = mpegCoder.MpegDecoder() # initialize
85+
d.setParameter(widthDst=400, heightDst=300) # noted that these options must be set before 'FFmpegSetup'!
86+
d.FFmpegSetup(b'i.avi') # the original video size would not influence the output
87+
print(d) # examine the parameters. You could also get the original video size by 'getParameter'
88+
d.ExtractFrame(0, 100) # get 100 frames with 400x300
89+
```
9190

92-
In another example, the set optional parameters could be inherited by encoder, too:
91+
In another example, the set optional parameters could be inherited by encoder, too:
9392

94-
```python
95-
d.setParameter(widthDst=400, heightDst=300) # set optional parameters
96-
...
97-
e.setParameter(decoder=d) # the width/height would inherit from widthDst/heightDst rather than original width/height of the decoder.
98-
```
93+
```python
94+
d.setParameter(widthDst=400, heightDst=300) # set optional parameters
95+
...
96+
e.setParameter(decoder=d) # the width/height would inherit from widthDst/heightDst rather than original width/height of the decoder.
97+
```
98+
99+
Noted that we do not provide `widthDst`/`heightDst` in `getParameter`, because these 2 options are all set by users. There is no need to get them from the video metadata.
99100

100-
Noted that we do not provide `widthDst`/`heightDst` in `getParameter`, because these 2 options are all set by users. There is no need to get them from the video metadata.
101-
102-
2. Optimize some realization of Decoder so that its efficiency could be improved.
101+
2. Optimize some realization of Decoder so that its efficiency could be improved.
103102

104103
### V1.7-linux update report:
105104

106-
Thanks to God, we succeed in this work!
105+
Thanks to God, we succeed in this work!
107106

108-
A new version is avaliable for Linux. To implement this tool, you need to install some libraries firstly:
107+
A new version is avaliable for Linux. To implement this tool, you need to install some libraries firstly:
109108

110-
* python3.5
109+
* python3.5
111110

112-
* numpy 1.13
111+
* numpy 1.13
113112

114-
If you want, you could install `ffmpeg` on Linux: Here are some instructions
113+
If you want, you could install `ffmpeg` on Linux: Here are some instructions
115114

116-
1. Check every pack which ffmpeg needs here: [Dependency of FFmpeg](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu "Dependency of FFmpeg")
115+
1. Check every pack which ffmpeg needs here: [Dependency of FFmpeg](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu "Dependency of FFmpeg")
117116

118-
2. Use these steps to install ffmpeg instead of provided commands on the above site.
117+
2. Use these steps to install ffmpeg instead of provided commands on the above site.
119118

120-
```Bash
121-
$ git clone https://git.ffmpeg.org/ffmpeg.git
122-
$ cd ffmpeg
123-
$ ./configure --prefix=host --enable-gpl --enable-libx264 --enable-libx265 --enable-shared --disable-static --disable-doc
124-
$ make
125-
$ make install
126-
```
119+
```Bash
120+
$ git clone https://git.ffmpeg.org/ffmpeg.git
121+
$ cd ffmpeg
122+
$ ./configure --prefix=host --enable-gpl --enable-libx264 --enable-libx265 --enable-shared --disable-static --disable-doc
123+
$ make
124+
$ make install
125+
```
127126

128127
### V1.7 update report:
129128

130-
1. Realize the encoder totally.
129+
1. Realize the encoder totally.
131130

132-
2. Provide a global option `dumpLevel` to control the log shown in the screen.
131+
2. Provide a global option `dumpLevel` to control the log shown in the screen.
133132

134-
3. Fix bugs in initialize functions.
133+
3. Fix bugs in initialize functions.
135134

136135
### V1.5 update report:
137136

138-
1. Provide an incomplete version of encoder, which could encode frames as a video stream that could not be played by player.
137+
1. Provide an incomplete version of encoder, which could encode frames as a video stream that could not be played by player.
139138

140139
### V1.4 update report:
141140

142-
1. Fix a severe bug of the decoder, which causes the memory collapsed if decoding a lot of frames.
141+
1. Fix a severe bug of the decoder, which causes the memory collapsed if decoding a lot of frames.
143142

144143
### V1.2 update report:
145144

146-
1. Use numpy array to replace the native pyList, which improves the speed significantly.
145+
1. Use numpy array to replace the native pyList, which improves the speed significantly.
147146

148147
### V1.0 update report:
149-
1. Provide the decoder which could decode videos in arbitrary formats and arbitrary coding.
148+
1. Provide the decoder which could decode videos in arbitrary formats and arbitrary coding.
150149

151150
## Version of currently used FFmpeg library
152-
* libavcodec.so.58.6.103
153-
* libavformat.so.58.3.100
154-
* libavutil.so.56.5.100
155-
* libswresample.so.3.0.101
156-
* libswscale.so.5.0.101
151+
* libavcodec.so.58.6.103
152+
* libavformat.so.58.3.100
153+
* libavutil.so.56.5.100
154+
* libswresample.so.3.0.101
155+
* libswscale.so.5.0.101

0 commit comments

Comments
(0)

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