Skip to content

Commit b74fd50

Browse files
committed
3.1.0
Upload the Linux building script.
0 parents  commit b74fd50

19 files changed

+8183
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Others
2+
include/*
3+
lib/*
4+
.vs/*
5+
.vscode/*
6+
*.pdb
7+
*.pyd
8+
*.ipdb
9+
*.iobj
10+
*.exp
11+
*.log
12+
*.tlog
13+
*.lastbuildstate
14+
unsuccessfulbuild
15+
/MpegCoder/x64/
16+
17+
# Prerequisites
18+
*.d
19+
20+
# Compiled Object files
21+
*.slo
22+
*.lo
23+
*.o
24+
*.obj
25+
26+
# Precompiled Headers
27+
*.gch
28+
*.pch
29+
30+
# Compiled Dynamic libraries
31+
*.so
32+
*.dylib
33+
*.dll
34+
35+
# Fortran module files
36+
*.mod
37+
*.smod
38+
39+
# Compiled Static libraries
40+
*.lai
41+
*.la
42+
*.a
43+
*.lib
44+
45+
# Executables
46+
*.exe
47+
*.out
48+
*.app
49+
50+
51+
# Byte-compiled / optimized / DLL files
52+
__pycache__/
53+
*.py[cod]
54+
*$py.class
55+
56+
# Distribution / packaging
57+
.Python
58+
build/
59+
develop-eggs/
60+
dist/
61+
downloads/
62+
eggs/
63+
.eggs/
64+
lib/
65+
lib64/
66+
parts/
67+
sdist/
68+
var/
69+
wheels/
70+
pip-wheel-metadata/
71+
share/python-wheels/
72+
*.egg-info/
73+
.installed.cfg
74+
*.egg
75+
MANIFEST
76+
77+
# PyInstaller
78+
# Usually these files are written by a python script from a template
79+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
80+
*.manifest
81+
*.spec
82+
83+
# Installer logs
84+
pip-log.txt
85+
pip-delete-this-directory.txt
86+
87+
# Unit test / coverage reports
88+
htmlcov/
89+
.tox/
90+
.nox/
91+
.coverage
92+
.coverage.*
93+
.cache
94+
nosetests.xml
95+
coverage.xml
96+
*.cover
97+
*.py,cover
98+
.hypothesis/
99+
.pytest_cache/
100+
101+
# Translations
102+
*.mo
103+
*.pot
104+
105+
# Django stuff:
106+
*.log
107+
local_settings.py
108+
db.sqlite3
109+
db.sqlite3-journal
110+
111+
# Flask stuff:
112+
instance/
113+
.webassets-cache
114+
115+
# Scrapy stuff:
116+
.scrapy
117+
118+
# Sphinx documentation
119+
docs/_build/
120+
121+
# PyBuilder
122+
target/
123+
124+
# Jupyter Notebook
125+
.ipynb_checkpoints
126+
127+
# IPython
128+
profile_default/
129+
ipython_config.py
130+
131+
# pyenv
132+
.python-version
133+
134+
# pipenv
135+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
136+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
137+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
138+
# install all needed dependencies.
139+
#Pipfile.lock
140+
141+
# celery beat schedule file
142+
celerybeat-schedule
143+
144+
# SageMath parsed files
145+
*.sage.py
146+
147+
# Environments
148+
.env
149+
.venv
150+
env/
151+
venv/
152+
ENV/
153+
env.bak/
154+
venv.bak/
155+
156+
# Spyder project settings
157+
.spyderproject
158+
.spyproject
159+
160+
# Rope project settings
161+
.ropeproject
162+
163+
# mkdocs documentation
164+
/site
165+
166+
# mypy
167+
.mypy_cache/
168+
.dmypy.json
169+
dmypy.json
170+
171+
# Pyre type checker
172+
.pyre/

CHANGELOG.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# FFmpeg-Encoder-Decoder-for-Python
2+
3+
## Update Report
4+
5+
### V3.1.0 update report:
6+
7+
1. Support `str()` type for all string arguments.
8+
9+
2. Support `http`, `ftp`, `sftp` streams for `MpegServer`.
10+
11+
3. Support `nthread` option for `MpegDecoder`, `MpegEncoder`, `MpegClient` and `MpegServer`.
12+
13+
4. Fix typos in docstrings.
14+
15+
### V3.0.0 update report:
16+
17+
1. Fix a severe memory leaking bugs when using `AVPacket`.
18+
19+
2. Fix a bug caused by using `MpegClient.terminate()` when a video is closed by the server.
20+
21+
3. Support the `MpegServer`. This class is used for serving the online video streams.
22+
23+
4. Refactor the implementation of the loggings.
24+
25+
5. Add `getParameter()` and `setParameter(configDict)` APIs to `MpegEncoder` and `MpegServer`.
26+
27+
6. Move `FFMpeg` depedencies and the `OutputStream` class to the `cmpc` space.
28+
29+
7. Fix dependency issues and cpp standard issues.
30+
31+
8. Upgrade to `FFMpeg 4.4` Version.
32+
33+
9. Add a quick script for fetching the `FFMpeg` dependencies.
34+
35+
### V2.05 update report:
36+
37+
1. Fix a severe bug that causes the memory leak when using `MpegClient`.This bug also exists in `MpegDecoder`, but it seems that the bug would not cause memory leak in that case. (Although we have also fixed it now.)
38+
39+
2. Upgrade to `FFMpeg 4.0` Version.
40+
41+
### V2.01 update report:
42+
43+
1. Fix a bug that occurs when the first received frame may has a PTS larger than zero.
44+
45+
2. Enable the project produce the newest `FFMpeg 3.4.2` version and use `Python 3.6.4`, `numpy 1.14`.
46+
47+
### V2.0 update report:
48+
49+
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.
50+
51+
2. Improve the structure of the code and remove some unnecessary codes.
52+
53+
3. Provide a complete version of client, which could demux the video stream from a server in any network protocol.
54+
55+
### V1.8 update report:
56+
57+
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:
58+
59+
```python
60+
d = mpegCoder.MpegDecoder() # initialize
61+
d.setParameter(widthDst=400, heightDst=300) # noted that these options must be set before 'FFmpegSetup'!
62+
d.FFmpegSetup(b'i.avi') # the original video size would not influence the output
63+
print(d) # examine the parameters. You could also get the original video size by 'getParameter'
64+
d.ExtractFrame(0, 100) # get 100 frames with 400x300
65+
```
66+
67+
In another example, the set optional parameters could be inherited by encoder, too:
68+
69+
```python
70+
d.setParameter(widthDst=400, heightDst=300) # set optional parameters
71+
...
72+
e.setParameter(decoder=d) # the width/height would inherit from widthDst/heightDst rather than original width/height of the decoder.
73+
```
74+
75+
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.
76+
77+
2. Optimize some realization of Decoder so that its efficiency could be improved.
78+
79+
### V1.7-linux update report:
80+
81+
Thanks to God, we succeed in this work!
82+
83+
A new version is avaliable for Linux. To implement this tool, you need to install some libraries firstly:
84+
85+
* python3.5
86+
87+
* numpy 1.13
88+
89+
If you want, you could install `ffmpeg` on Linux: Here are some instructions
90+
91+
1. Check every pack which ffmpeg needs here: [Dependency of FFmpeg](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu "Dependency of FFmpeg")
92+
93+
2. Use these steps to install ffmpeg instead of provided commands on the above site.
94+
95+
```Bash
96+
$ git clone https://git.ffmpeg.org/ffmpeg.git
97+
$ cd ffmpeg
98+
$ ./configure --prefix=host --enable-gpl --enable-libx264 --enable-libx265 --enable-shared --disable-static --disable-doc
99+
$ make
100+
$ make install
101+
```
102+
103+
### V1.7 update report:
104+
105+
1. Realize the encoder totally.
106+
107+
2. Provide a global option `dumpLevel` to control the log shown in the screen.
108+
109+
3. Fix bugs in initialize functions.
110+
111+
### V1.5 update report:
112+
113+
1. Provide an incomplete version of encoder, which could encode frames as a video stream that could not be played by player.
114+
115+
### V1.4 update report:
116+
117+
1. Fix a severe bug of the decoder, which causes the memory collapsed if decoding a lot of frames.
118+
119+
### V1.2 update report:
120+
121+
1. Use numpy array to replace the native pyList, which improves the speed significantly.
122+
123+
### V1.0 update report:
124+
125+
1. Provide the decoder which could decode videos in arbitrary formats and arbitrary coding.

0 commit comments

Comments
 (0)