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

ImportError: No module named tracking (OS: 10.11.6 "El Capitan", Python 2.7.12) #348

Closed
bwagner opened this issue Oct 30, 2016 · 6 comments

Comments

@bwagner
Copy link
Contributor

bwagner commented Oct 30, 2016

I did pip install -U scikit-image
resulting in
Successfully installed dask-0.11.1 decorator-4.0.10 networkx-1.11 pillow-3.4.2 scikit-image-0.12.3 toolz-0.8.0

However, when running this code:

from moviepy.editor import VideoFileClip
from moviepy.tools.tracking import manual_tracking

I get this error:

Traceback (most recent call last):
  File "tracking.py", line 2, in <module>
    from moviepy.tools.tracking import manual_tracking
ImportError: No module named tracking

@ghost
Copy link

ghost commented Feb 14, 2017

This error seems to be from an error in how moviepy was installed
Can you try to reinstall moviepy?

@ghost
Copy link

ghost commented Feb 17, 2017

try the following:

from moviepy.editor import VideoFileClip
from moviepy.video.tools.tracking import manual_tracking

note that the second from .. import contains video

@keikoro
Copy link
Collaborator

keikoro commented Feb 17, 2017

@Earney Slightly off-topic, but as I've noticed this more than once now: code is better readable if it's formatted as such. Helps differentiate between e.g. instructions on how to do things and actual commands.

In case the Markdown formatting is unknown: this can be achieved with backticks (french accents) – single ones for individual words like so, triple backticks for code blocks. Though there's also a button for code in the formatting bar of these comment fields. More info by GitHub.

@ghost
Copy link

ghost commented Mar 7, 2017

@bwagner closing this issue. please reopen if you need additional help.

@ghost ghost closed this as completed Mar 7, 2017
@bwagner
Copy link
Contributor Author

bwagner commented Jul 9, 2017

FYI, this somehow worked:

from moviepy.editor import *
from moviepy.video.tools.tracking import manual_tracking
from moviepy.video.tools.tracking import Trajectory

clip = VideoFileClip("SonarOrig.mp4").subclip(50,60)

trajectories = manual_tracking(clip, t1=5, t2=7, fps=5,
                                       nobjects=1, savefile="track.txt")

This generated a file track.txt (as an intermediate result to check):

# t(ms)	x	y
5000	438	338
5200	495	685
5400	714	303
5600	351	72
5800	44	674
6000	658	666
6200	713	378
6400	901	468
6600	901	468
6800	901	468

traj, = Trajectory.load_list("track.txt")

clip_blurred = clip.fx( vfx.headblur, traj.xi, traj.yi, 50)

clip_blurred.write_videofile('blurred.mp4', bitrate="3000k")

It might make sense to update the documentation:
https://zulko.github.io/moviepy/examples/headblur.html

@bwagner
Copy link
Contributor Author

bwagner commented Jul 9, 2017

I'm still struggling with something when capturing the trajectory: The video that is being played for capturing seems to finish before I got a chance to do all my tracking, even when setting fps=None.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants