Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #3

Merged
merged 98 commits into from
Feb 27, 2017
Merged
Changes from 1 commit
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
4e60a71
Fixed copy-paste typo
temerick Aug 24, 2015
f0372ad
Fixed missing list
Sep 20, 2015
efaba09
fixed module hierarchy for Trajectory
bwagner Oct 7, 2015
2153c20
fixed addy
bwagner Oct 7, 2015
3ae11f5
small recipe
Dec 23, 2015
8d0cc38
on_color function docstring has wrong parameter
cblument Dec 28, 2015
f0dc512
Update README.rst
tcyrus Jan 26, 2016
8986d2f
fix deprecation message
mgaitan Jun 16, 2016
85c631d
ImageSequenceClip: Check for fps and durations rather than fps and du…
jeromegrosse Oct 10, 2016
33e2975
Add a test case.
Oct 17, 2016
870a5f4
Add another test
Oct 17, 2016
814b776
ensures int arguments to np.reshape; closes #383
tyarkoni Jan 16, 2017
04b6bc6
fix issue #401
Feb 10, 2017
6453c7f
Merge pull request #405 from Gloin1313/master
Zulko Feb 14, 2017
05e88b7
Merge pull request #2 from Zulko/master
bearney74 Feb 14, 2017
015f9a3
fix issue #335
Feb 15, 2017
afa1eb3
Update maintainer section in README
mbeacom Feb 15, 2017
eb32bc1
Merge pull request #409 from mbeacom/fix-readme
Feb 15, 2017
212db1f
Merge pull request #403 from earney/master
Feb 15, 2017
a49be81
Merge pull request #384 from tyarkoni/master
Feb 15, 2017
ef83248
Merge pull request #3 from Zulko/master
bearney74 Feb 15, 2017
ceb4076
Merge pull request #244 from cblument/doc_fix
Feb 15, 2017
13ac192
Merge pull request #4 from Zulko/master
bearney74 Feb 15, 2017
a87b99b
make concatenate_videoclips Python 3 compatible.. fix issue #313
Feb 15, 2017
3137695
Merge pull request #410 from earney/master
Feb 15, 2017
bed4266
Increment release version
mbeacom Feb 15, 2017
20a70f0
CompositeVideoClip doesn't accept an argument of transparent
Feb 15, 2017
a5a575a
move PY3 variable to compat.py
Feb 15, 2017
8a7f841
Merge pull request #5 from Zulko/master
bearney74 Feb 15, 2017
8c1aaa5
fix movie => moviepy typo
Feb 15, 2017
cec4511
fix issue #341
Feb 15, 2017
a38e4cd
Merge branch 'master' of github.com:earney/moviepy
Feb 15, 2017
2f824b0
Merge pull request #411 from earney/master
bearney74 Feb 15, 2017
e3480c6
Fixed typo #375
Feb 15, 2017
16d7c81
Merge pull request #6 from Zulko/master
bearney74 Feb 15, 2017
f4a4606
fix issue #357, which makes real problem more obvious (media file doe…
Feb 15, 2017
75bc1af
Merge pull request #243 from zodman/master
bearney74 Feb 15, 2017
f7ad6be
Revert "small recipe (mirroring a video)"
Zulko Feb 15, 2017
54bdeeb
Merge pull request #414 from Zulko/revert-243-master
Zulko Feb 15, 2017
ca009a3
Merge pull request #7 from Zulko/master
bearney74 Feb 15, 2017
118f952
Merge pull request #302 from mgaitan/patch-2
Feb 16, 2017
fb023fb
Merge pull request #254 from tcyrus/patch-1
Feb 16, 2017
1381b38
Merge pull request #8 from Zulko/master
bearney74 Feb 16, 2017
64871cf
Merge pull request #331 from jeromegrosse/bug-imagesequenceclip-duration
bearney74 Feb 17, 2017
c7e46a0
Merge branch 'master' of https://github.com/Zulko/moviepy
tburrows13 Feb 18, 2017
58f9022
Fixed indentation
Feb 18, 2017
2b9b14b
.gitignore ignore Mac-specific files, Jetbrains settings dir
kerstin Feb 19, 2017
0360aee
README.rst make mention of Gitter, add PyPI and Gitter badge
kerstin Feb 19, 2017
24c538a
README.rst wording, formatting
kerstin Feb 19, 2017
8ab44ea
README.rst structure link targets, add co-maintainers (with @username)
kerstin Feb 19, 2017
11cc67d
README.rst move maintainers, contributing sections; change docs x-ref…
kerstin Feb 19, 2017
fdd9413
README.rst fix grammar
kerstin Feb 19, 2017
3d91ddd
Merge pull request #413 from earney/master
bearney74 Feb 20, 2017
b4cf52f
fix issue 145. raise Exception when concatenate method != chain or c…
bearney74 Feb 20, 2017
1bb1e3c
make PEP8 compatible
bearney74 Feb 20, 2017
35b4e5e
Merge pull request #428 from earney/issue_145
Zulko Feb 20, 2017
edbb772
Merge pull request #425 from kerstin/readme_improvements
kerstin Feb 20, 2017
639e449
fix PR #413 . (issue #357)
bearney74 Feb 20, 2017
5ef16e9
Merge pull request #429 from earney/issue_145
bearney74 Feb 20, 2017
f8092d0
Merge pull request #1 from Zulko/master
bearney74 Feb 20, 2017
ed4adbe
create test for issue #145
bearney74 Feb 20, 2017
19d4f03
add tests/media to .gitignore
bearney74 Feb 21, 2017
d3582b1
Merge pull request #431 from earney/pytest
bearney74 Feb 21, 2017
360a407
Merge pull request #2 from Zulko/master
bearney74 Feb 21, 2017
66c061f
Merge pull request #339 from drewm1980/master
bearney74 Feb 21, 2017
cbbb276
Merge pull request #3 from Zulko/master
bearney74 Feb 21, 2017
2e036d3
Merge pull request #197 from temerick/patch-1
bearney74 Feb 21, 2017
e4d9032
Merge pull request #211 from LunarLanding/patch-1
bearney74 Feb 21, 2017
ce38d41
Merge pull request #215 from bwagner/master
bearney74 Feb 21, 2017
fca1727
fix Issue #385 , no DirectoryClip class (#434)
bearney74 Feb 21, 2017
3870506
fix issue 417, unicode has no attribute 'shape' error.
bearney74 Feb 22, 2017
3ec5106
add test for issue 417
bearney74 Feb 22, 2017
3d877cb
add test for issue 417
bearney74 Feb 22, 2017
32b7007
Fixed resize documentation issue #319 (#346)
jmisacube Feb 22, 2017
fe3474e
Merge pull request #4 from Zulko/master
bearney74 Feb 22, 2017
df31c03
Handle bytes when listing fonts in VideoClip.py (#306)
Zowie Feb 22, 2017
c019484
Merge pull request #5 from Zulko/master
bearney74 Feb 22, 2017
f07e6a3
add test for PR306
bearney74 Feb 22, 2017
ba1dd25
add test for PR306 (#440)
bearney74 Feb 22, 2017
319a52d
Merge pull request #6 from Zulko/master
bearney74 Feb 22, 2017
372177a
create test file for pull requests (#433)
bearney74 Feb 23, 2017
09d3572
Test issue 407 (video has a valid fps after concatenate function) (#443)
bearney74 Feb 23, 2017
674b1d7
Merge pull request #7 from Zulko/master
bearney74 Feb 23, 2017
fd36a54
Move PR test to test_PR.py file (#444)
bearney74 Feb 23, 2017
4446225
fix merge issue, add code to add python image for tests
bearney74 Feb 23, 2017
8c41594
Merge branch 'earney-issue417'
bearney74 Feb 23, 2017
9e6b9c8
add code to download python_logo.png
bearney74 Feb 23, 2017
ff44f23
Merge branch 'master' into issue417
bearney74 Feb 23, 2017
b3dba11
Merge branch 'master' into master
bearney74 Feb 23, 2017
83ed8a5
Merge pull request #438 from earney/issue417
bearney74 Feb 24, 2017
b1016cb
remove duplicate test_issue_417 function
bearney74 Feb 24, 2017
ff82fe8
add testing with travis-ci (#447)
bearney74 Feb 26, 2017
ec57a19
put DEVNULL into compat.py (#432)
bearney74 Feb 26, 2017
e8d124a
add travis-ci badge to readme file
bearney74 Feb 26, 2017
c0f6925
pick highest fps when concatenating (#416)
BrianLee608 Feb 27, 2017
5eb43c9
add test for issue 416
bearney74 Feb 27, 2017
04bb711
fix test_issue_416
bearney74 Feb 27, 2017
b8bc801
Merge branch 'master' into master
Feb 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pick highest fps when concatenating (Zulko#416)
* readers.py cast chunksize from float to int

* choose highest fps of clips when concatenating

* pick highest fps when concatenating

* pick highest fps when concatenating

* fps either max or none

* remove resolve markers

removed resolve markers such as HEAD, etc so that the file will compile correctly.
Remove some double blank lines, etc

* update concatenate.py; add c.fps is not None
BrianLee608 authored and bearney74 committed Feb 27, 2017
commit c0f692585a489e117d3e3593913856db1d7321f5
5 changes: 2 additions & 3 deletions moviepy/audio/io/readers.py
Original file line number Diff line number Diff line change
@@ -110,6 +110,8 @@ def skip_chunk(self,chunksize):


def read_chunk(self,chunksize):
# chunksize is not being autoconverted from float to int
chunksize = int(round(chunksize))
L = self.nchannels*chunksize*self.nbytes
s = self.proc.stdout.read(L)
dt = {1: 'int8',2:'int16',4:'int32'}[self.nbytes]
@@ -234,6 +236,3 @@ def buffer_around(self,framenumber):

def __del__(self):
self.close_proc()



36 changes: 15 additions & 21 deletions moviepy/video/compositing/concatenate.py
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@
def concatenate_videoclips(clips, method="chain", transition=None,
bg_color=None, ismask=False, padding = 0):
""" Concatenates several video clips

Returns a video clip made by clip by concatenating several video clips.
(Concatenated means that they will be played one after another).

There are two methods:

- method="chain": will produce a clip that simply outputs
@@ -38,56 +38,50 @@ def concatenate_videoclips(clips, method="chain", transition=None,
will be transparent if mask=True, else it will be of the
color specified by ``bg_color``.

If all clips with a fps attribute have the same fps, it becomes the fps of
the result.
The clip with the highest FPS will be the FPS of the result clip.

Parameters
-----------

clips
A list of video clips which must all have their ``duration``
attributes set.

method
"chain" or "compose": see above.

transition
A clip that will be played between each two clips of the list.

bg_color
Only for method='compose'. Color of the background.
Set to None for a transparent clip

padding
Only for method='compose'. Duration during two consecutive clips.
Note that for negative padding, a clip will partly play at the same
time as the clip it follows (negative padding is cool for clips who fade
in on one another). A non-null padding automatically sets the method to
`compose`.

"""

if transition is not None:
l = [[v, transition] for v in clips[:-1]]
clips = reduce(lambda x, y: x + y, l) + [clips[-1]]
transition = None


tt = np.cumsum([0] + [c.duration for c in clips])

sizes = [v.size for v in clips]


w = max([r[0] for r in sizes])
h = max([r[1] for r in sizes])

tt = np.maximum(0, tt + padding*np.arange(len(tt)))

if method == "chain":
def make_frame(t):
i = max([i for i, e in enumerate(tt) if e <= t])
return clips[i].get_frame(t - tt[i])

result = VideoClip(ismask = ismask, make_frame = make_frame)
if any([c.mask is not None for c in clips]):
masks = [c.mask if (c.mask is not None) else
@@ -96,8 +90,6 @@ def make_frame(t):
for c in clips]
result.mask = concatenate_videoclips(masks, method="chain", ismask=True)
result.clips = clips


elif method == "compose":
result = CompositeVideoClip( [c.set_start(t).set_pos('center')
for (c, t) in zip(clips, tt)],
@@ -107,18 +99,20 @@ def make_frame(t):
"concatenate_videoclips must be 'chain' or 'compose'")

result.tt = tt

result.start_times = tt[:-1]
result.start, result.duration, result.end = 0, tt[-1] , tt[-1]

audio_t = [(c.audio,t) for c,t in zip(clips,tt) if c.audio is not None]
if len(audio_t)>0:
result.audio = CompositeAudioClip([a.set_start(t)
for a,t in audio_t])

fps_list = list(set([c.fps for c in clips if hasattr(c,'fps')]))
if len(fps_list)==1:
result.fps= fps_list[0]
fpss = [c.fps for c in clips if hasattr(c,'fps') and c.fps is not None]
if len(fpss) == 0:
result.fps = None
else:
result.fps = max(fpss)

return result