Video editing with Python
fix YT embeds: replace AS3 objects w iframes, mixed content (http -> https)
Kerstin Kollmanna8c46da758c4
diff --git a/docs/examples/compo_from_image.rst b/docs/examples/compo_from_image.rstindex 8d3cd24c..45916416 100644--- a/docs/examples/compo_from_image.rst+++ b/docs/examples/compo_from_image.rst@@ -7,15 +7,7 @@ So how do you do some complex compositing like this ?.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/1hdgNxX-tas&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/1hdgNxX-tas&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/1hdgNxX-tas&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>It takes a lot of bad taste, and a segmenting tooldiff --git a/docs/examples/dancing_knights.rst b/docs/examples/dancing_knights.rstindex f18c6ec2..e52e6572 100644--- a/docs/examples/dancing_knights.rst+++ b/docs/examples/dancing_knights.rst@@ -6,9 +6,9 @@ And now for something very silly..... raw:: html- <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;margin-left: 5%;">- <iframe src="http://youtube.com/v/Qu7HJrsEYFg?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/Qu7HJrsEYFg?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>diff --git a/docs/examples/example_with_sound.rst b/docs/examples/example_with_sound.rstindex fe0a2a1f..6a54bb68 100644--- a/docs/examples/example_with_sound.rst+++ b/docs/examples/example_with_sound.rst@@ -7,15 +7,7 @@ An example of using MoviePy to assemble movie clips with sounds. Here are two sc.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/gtyFuIoH7W0&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/gtyFuIoH7W0&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/gtyFuIoH7W0&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>Here is the code:diff --git a/docs/examples/headblur.rst b/docs/examples/headblur.rstindex 5c428552..11f9d22d 100644--- a/docs/examples/headblur.rst+++ b/docs/examples/headblur.rst@@ -4,15 +4,7 @@ Tracking and blurring someone's face.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/FWCKYTRCrBI&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/FWCKYTRCrBI&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/FWCKYTRCrBI&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>First we will need to track the face, i.e. to get two functions ``fx`` and ``fy`` such that ``(fx(t),fy(t))`` gives the position of the center of the head at time ``t``. This will be easily done with`manual_tracking`. Then we will need to blur the area of the video around the center of the head.diff --git a/docs/examples/logo.rst b/docs/examples/logo.rstindex 1ee4c5fe..a47f4002 100644--- a/docs/examples/logo.rst+++ b/docs/examples/logo.rst@@ -3,16 +3,8 @@ MoviePy logo with a moving shadow=================================.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/TG86KzL18NA&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/TG86KzL18NA&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/TG86KzL18NA&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>Here the logo is a picture, while the shadow is actually a black rectangle taking the whole screen, overlaid over the logo, but with a moving mask composed of a bi-gradient, such that only one (moving) part of the rectangle is visible. See :ref:`gradients` for the code of the function `biGradient`: ::-+diff --git a/docs/examples/masked_credits.rst b/docs/examples/masked_credits.rstindex d2649c59..838c7319 100644--- a/docs/examples/masked_credits.rst+++ b/docs/examples/masked_credits.rst@@ -5,32 +5,13 @@ Partially Hidden credits.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/NsTgBah6Ebk&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/NsTgBah6Ebk&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/NsTgBah6Ebk&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>First, see in :ref:`autocredits` how to make credits automatically with MoviePy. Before seeing the code for this video, here is a tutorial video that explains the different steps (also made with MoviePy):--.. raw:: html-- <center>- <object><param name="movie"- value="http://www.youtube.com/v/7tKABfc0Yzw&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/7tKABfc0Yzw&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+.. raw:: html+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/7tKABfc0Yzw&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>And here is the code:diff --git a/docs/examples/moving_letters.rst b/docs/examples/moving_letters.rstindex 0b4f910f..1479aea2 100644--- a/docs/examples/moving_letters.rst+++ b/docs/examples/moving_letters.rst@@ -6,16 +6,7 @@ I think this example illustrates well the interest of script-based editing (imag.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/jj5qrHl5ZS0&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/jj5qrHl5ZS0&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/jj5qrHl5ZS0&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>Here is the code:diff --git a/docs/examples/painting_effect.rst b/docs/examples/painting_effect.rstindex a27737a2..127a22cd 100644--- a/docs/examples/painting_effect.rst+++ b/docs/examples/painting_effect.rst@@ -6,15 +6,7 @@ That's an effect that we have seen a lot in westerns and such... raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/aC5CifkacSI&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/aC5CifkacSI&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/aC5CifkacSI&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>The recipe used to make a photo look like a painting:diff --git a/docs/examples/severalCharacters.rst b/docs/examples/severalCharacters.rstindex 29044345..48f9e197 100644--- a/docs/examples/severalCharacters.rst+++ b/docs/examples/severalCharacters.rst@@ -6,15 +6,6 @@ Character duplication in a video.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/sZMyzzGlsc0&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/sZMyzzGlsc0&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/sZMyzzGlsc0&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>So blabladiff --git a/docs/examples/star_worms.rst b/docs/examples/star_worms.rstindex 71f7b4c9..68a2d4c7 100644--- a/docs/examples/star_worms.rst+++ b/docs/examples/star_worms.rst@@ -1,36 +1,18 @@A Star-Wars like opening title--------------------------------This is an approximate effect (the perspective would require some more complex transformations) but it is a nice exercise.+This is an approximate effect (the perspective would require some more complex transformations) but it is a nice exercise.Warning: clip with sound... raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/5euLdo8L0o0&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/5euLdo8L0o0&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-Let us also have a look at this tutorial which shows the different steps:.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/dGrP7GhzWEE&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/dGrP7GhzWEE&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/5euLdo8L0o0&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>+And here you are for the code, and for the code of the tutorial... literalinclude:: ../../examples/star_worms.pydiff --git a/docs/examples/the_end.rst b/docs/examples/the_end.rstindex ef129b20..e89fd4f7 100644--- a/docs/examples/the_end.rst+++ b/docs/examples/the_end.rst@@ -4,21 +4,13 @@.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/sZMyzzGlsc0&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/sZMyzzGlsc0&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/sZMyzzGlsc0&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>+So let's explain this one: there is a clip with "The End" written in the middle, and *above* thisclip there is the actual movie. The actual movie has a mask which representsa white (=opaque) circle on a black (=transparent) background. At the begining,that circle is so large that you see all the actual movie and you don't seethe "The End" clip. Then the circle becomes progressively smaller and as aconsequence you see less of the actual movie and more of the "The End" clip.-+.. literalinclude:: ../../examples/the_end.pydiff --git a/docs/examples/ukulele_concerto.rst b/docs/examples/ukulele_concerto.rstindex 25c27041..707493f7 100644--- a/docs/examples/ukulele_concerto.rst+++ b/docs/examples/ukulele_concerto.rst@@ -4,16 +4,7 @@ A simple music video.. raw:: html- <center>- <object><param name="movie"- value="http://www.youtube.com/v/AqGZ4JFkQTU&hl=en_US&fs=1&rel=0">- </param><param name="allowFullScreen" value="true"></param><param- name="allowscriptaccess" value="always"></param><embed- src="http://www.youtube.com/v/AqGZ4JFkQTU&hl=en_US&fs=1&rel=0"- type="application/x-shockwave-flash" allowscriptaccess="always"- allowfullscreen="true" width="550" height="450"></embed></object>- </center>-+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;"><iframe type="text/html" src="https://youtube.com/embed/AqGZ4JFkQTU&hl=en_US&fs=1&rel=0" frameborder="0" style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>This is an example, with no sound (lame for a music video), soon to bereplaced with a real music video example (the code will be 99% the same).diff --git a/docs/gallery.rst b/docs/gallery.rstindex 786924ff..6bdf8306 100644--- a/docs/gallery.rst+++ b/docs/gallery.rst@@ -17,9 +17,9 @@ This mix of 60 covers of the Cup Song demonstrates the non-linear video editing.. raw:: html- <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;+ <div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden;margin-left: 5%;">- <iframe src="http://youtube.com/v/rIehsqqYFEM&hl?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/rIehsqqYFEM&hl?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; width: 90%; height: 100%;"></iframe></div>@@ -33,7 +33,7 @@ in the :ref:`examples`... raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/zGhoZ4UBxEQ&hl?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/zGhoZ4UBxEQ&hl?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -86,7 +86,7 @@ With Vapory and MoviePy you can for instance embed a movie in a 3D scene:.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; margin-bottom:30px; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/M9R21SquDSk?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/M9R21SquDSk?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -106,7 +106,7 @@ Or use `this script <https://gist.github.com/Zulko/b910c8b22e8e1c01fae6>`_ to ma.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; margin-bottom:30px; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/tCqQhmuwgMg?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/tCqQhmuwgMg?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -129,7 +129,7 @@ This `blog post <http://zulko.github.io/blog/2014/02/12/transcribing-piano-rolls.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; margin-bottom:30px; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/V2XCJNZjm4w&hl?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/V2XCJNZjm4w&hl?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -142,7 +142,7 @@ Misc. Programs and Scripts using MoviePyRinconcam-----------`Rincomcam <http://www.rinconcam.com/month/2014-03>`_ is a camera which films surfers on the Californian beach of Point Rincon. At the end of each day it cuts together a video, puts it online, and tweets it. Everything is entirely automatized with Python.+`Rincomcam <http://www.rinconcam.com/month/2014-03>`_ is a camera which films surfers on the Californian beach of Point Rincon. At the end of each day it cuts together a video, puts it online, and tweets it. Everything is entirely automatized with Python.MoviePy is used to add transitions, titles and music to the videos.@@ -160,7 +160,7 @@ Videogrep is a python script written by Sam Lavigne, that goes through the subti.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/D7pymdCU5NQ&hl?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/D7pymdCU5NQ&hl?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -171,7 +171,7 @@ Here are `Videogrep's introductory blog postIf you liked it, also have a look at these Videogrep-inspired projects:This `blog post <http://zulko.github.io/blog/2014/06/21/some-more-videogreping-with-python/>`_ attempts to cut a video precisely at the beginning and end of sentences or words: ::-+words = ["Americans", "must", "develop", "open ", "source"," software", "for the", " rest ", "of the world","instead of", " soldiers"]@@ -183,7 +183,7 @@ This `blog post <http://zulko.github.io/blog/2014/06/21/some-more-videogreping-w.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/iWRYGULFd_c?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/iWRYGULFd_c?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>@@ -194,7 +194,7 @@ This `other post <http://zulko.github.io/blog/2014/07/04/automatic-soccer-highli.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left: 5%;">- <iframe src="http://youtube.com/v/zJtWPFX2bA0?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/zJtWPFX2bA0?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; left: 0; width: 90%; height: 100%;"></iframe></div>diff --git a/docs/getting_started/compositing.rst b/docs/getting_started/compositing.rstindex feb2c319..f064527f 100644--- a/docs/getting_started/compositing.rst+++ b/docs/getting_started/compositing.rst@@ -8,7 +8,7 @@ Video composition, also known as non-linear editing, is the fact of playing seve.. raw:: html<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; margin-bottom:30px; height: 0; overflow: hidden; margin-left:15%;">- <iframe src="http://youtube.com/v/rIehsqqYFEM&hl?rel=0" frameborder="0" allowfullscreen+ <iframe type="text/html" src="https://youtube.com/embed/rIehsqqYFEM&hl?rel=0" frameborder="0"style="position: absolute; top: 0; bottom: 10; width: 70%; height: 100%; "></iframe></div>@@ -21,7 +21,7 @@ Stacking and concatenating clipsTwo simple ways of putting clips together is to concatenate them (to play them one after the other in a single long clip) or to stack them (to them side by side in a single larger clip).Concatenation is done with the function ``concatenate_videoclips``: ::-+from moviepy.editor import VideoFileClip, concatenate_videoclipsclip1 = VideoFileClip("myvideo.mp4")clip2 = VideoFileClip("myvideo2.mp4").subclip(50,60)@@ -33,7 +33,7 @@ Concatenation is done with the function ``concatenate_videoclips``: ::The ``final_clip`` is a clip that plays the clips 1, 2, and 3 one after the other. Note that the clips do not need to be the same size. If they arent's they will all appear centered in a clip large enough to contain the biggest of them, with optionnally a color of your choosing to fill the borders. You have many other options there (see the doc of the function). You can for instance play a transition clip between the clips with the option ``transition=my_clip``.Stacking is done with ``clip_array``: ::-+from moviepy.editor import VideoFileClip, clips_array, vfxclip1 = VideoFileClip("myvideo.mp4").margin(10) # add 10px contourclip2 = clip1.fx( vfx.mirror_x)@@ -53,9 +53,9 @@ CompositeVideoClips~~~~~~~~~~~~~~~~~~~~~The `CompositeVideoClip` class provides a very flexible way to compose clips, but is more complex than ``concatenate_videoclips`` and ``clips_array`` ::-+video = CompositeVideoClip([clip1,clip2,clip3])-+Now ``video`` plays ``clip1``, and ``clip2`` *on top of* ``clip1``, and ``clip3`` on top of ``clip1``, and ``clip2``. For instance, if ``clip2`` and ``clip3`` have the same size as ``clip1``, then only ``clip3``, which is on top, will be visible in the video... unless ``clip3`` and ``clip2`` have masks which hide parts of them. Note that by default the composition has the size of its first clip (as it is generally a *background*). But sometimes you will want to make your clips *float* in a bigger composition, so you will specify the size of the final composition as follows ::video = CompositeVideoClip([clip1,clip2,clip3], size=(720,460))@@ -64,8 +64,8 @@ Starting and stopping times""""""""""""""""""""""""""""In a CompositionClip, all the clips start to play at a time that is specified by the ``clip.start`` attribute. You can set this starting time as follows: ::-- clip1 = clip1.set_start(5) # start after 5 seconds++ clip1 = clip1.set_start(5) # start after 5 secondsSo for instance your composition will look like ::@@ -74,7 +74,7 @@ So for instance your composition will look like ::clip3.set_start(9)]) # start at t=9sIn the example above, maybe ``clip2`` will start before ``clip1`` is over. In this case you can make ``clip2`` appear with a *fade-in* effect of one second: ::-+video = CompositeVideoClip([clip1, # starts at t=0clip2.set_start(5).crossfadein(1),clip3.set_start(9).crossfadein(1.5)])@@ -83,15 +83,15 @@ Positioning clips""""""""""""""""""If ``clip2`` and ``clip3`` are smaller than ``clip1``, you can decide where they will appear in the composition by setting their position. Here we indicate the coordinates of the top-left pixel of the clips: ::-+video = CompositeVideoClip([clip1,clip2.set_pos((45,150)),clip3.set_pos((90,100))])There are many ways to specify the position: ::-+clip2.set_pos((45,150)) # x=45, y=150 , in pixels-+clip2.set_pos("center") # automatically centered# clip2 is horizontally centered, and at the top of the picture@@ -99,10 +99,10 @@ There are many ways to specify the position: ::# clip2 is vertically centered, at the left of the pictureclip2.set_pos(("left","center"))-+# clip2 is at 40% of the width, 70% of the height of the screen:clip2.set_pos((0.4,0.7), relative=True)-+# clip2's position is horizontally centered, and moving down !clip2.set_pos(lambda t: ('center', 50+t) )@@ -113,7 +113,7 @@ When indicating the position keep in mind that the ``y`` coordinate has its zero.. Transitions.. -------------.. Everyone loves transitions between clips: fade-ins, fade-out, clips that slide in front of the previous one... everything is good to impress your grandparents.+.. Everyone loves transitions between clips: fade-ins, fade-out, clips that slide in front of the previous one... everything is good to impress your grandparents... In MoviePy, transitions are effects (see :ref:`effects`_) from the module moviepy.video.compositing.diff --git a/docs/index.rst b/docs/index.rstindex eb889aca..cbfd9203 100644--- a/docs/index.rst+++ b/docs/index.rst@@ -21,14 +21,14 @@ User Guide.. toctree:::maxdepth: 1-+installgetting_started/getting_startedgalleryexamples/examplesFAQref/ref-+Contribute !--------------@@ -43,8 +43,8 @@ MoviePy is an open source software originally written by Zulko_ and released undif(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>-- <iframe src="http://ghbtns.com/github-btn.html?user=Zulko&repo=moviepy&type=watch&count=true&size=large"++ <iframe type="text/html" src="http://ghbtns.com/github-btn.html?user=Zulko&repo=moviepy&type=watch&count=true&size=large"allowtransparency="true" frameborder="0" scrolling="0" width="152px" height="30px"></iframe>.. <a href="https://github.com/Zulko/moviepy">.. <img style="position: absolute; top: 0; right: 0; border: 0;"