-1

code and output

From Command prompt

I've tried many times to display the video using moviepy but it doesn't work I also tried to display it using command prompt but still the same problem.. So what should I do or what I am missing ?? help me please as this is a part of my graduation project and thank you.

this is the code

from moviepy.editor import *


myvideo =  VideoFileClip('C:/Users/Sohayla/Desktop/PythonSourceCode/road_lane_line_detection-master/challenge.MP4').rotate(180)
myvideo.ipython_display()
Ari Cooper-Davis
  • 3,374
  • 3
  • 26
  • 43
  • 2
    No screenshots, please copy and paste the text into the post. – spicypumpkin Apr 03 '17 at 18:03
  • Agree with @Posh_Pumpkin, having code in images is a bad habit for multiple reasons. Regarding the question: I'd try `IPython.display.DisplayObject(data=myvideo)` or `IPython.display.DisplayObject(filename=myvideo)`. Overal, read [the documentation of the moviepy plugin](http://zulko.github.io/moviepy/) and that of the [ipython display module](https://ipython.org/ipython-doc/3/api/generated/IPython.display.html). Find out what kind of an object is created by the first one and what kind is required by the second one.. make sure it is being fed the required input in the correct format. – Montmons Apr 03 '17 at 18:43
  • PS: Thnx for adding the code in your question! Please, also apply the correct markup to enhance readability. – Montmons Apr 03 '17 at 18:46

2 Answers2

2

As shown in the documentation of moviepy:

enter image description here

So, in your code:

from moviepy.editor import * 
myvideo = VideoFileClip('C:/Users/Sohayla/Desktop/PythonSourceCode/road_lane_line_detection-master/challenge.MP4').rotate(180) 
ipython_display(myvideo)

Should work..

Better would be:

from moviepy.editor import VideoFileClip 
myvideo = VideoFileClip('C:/Users/Sohayla/Desktop/PythonSourceCode/road_lane_line_detection-master/challenge.MP4').rotate(180) 
ipython_display(myvideo)
Badri
  • 67
  • 1
  • 8
Montmons
  • 1,416
  • 13
  • 44
  • it produce that the file size exceeds configured limit code insight feature not available in file _temp_.mp4 – سهيلة عصام Apr 03 '17 at 18:55
  • Try a smaller .mp4 file. Like this one for example: http://techslides.com/demos/sample-videos/small.mp4 – Montmons Apr 03 '17 at 18:58
  • If it does work it probably means python display is only able to play video of a pre-defined size and yours is too large. You can probably use moviepy to downsize it. – Montmons Apr 03 '17 at 19:03
  • If it does work with a smaller mp4 you might mark this as solved. – Montmons Apr 10 '17 at 16:15
  • You can use `clip.resize()` to make the video smaller. Refer to the docs [here](http://zulko.github.io/moviepy/ref/videofx/moviepy.video.fx.all.resize.html). – Tom Burrows Apr 13 '17 at 08:42
0

Instead of using the ipython_display you can use resize() function as video.resize() to change its height or width.

Video.resize(width=300) It will work fine.