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

not working with some youtube videos #82

Closed
ttback opened this issue Oct 19, 2014 · 5 comments
Closed

not working with some youtube videos #82

ttback opened this issue Oct 19, 2014 · 5 comments

Comments

@ttback
Copy link

ttback commented Oct 19, 2014

Youtube:
https://www.youtube.com/watch?v=ZZ5LpwO-An4&t=86s

Error

Exception AttributeError: "VideoFileClip instance has no attribute 'reader'" 
in <bound method VideoFileClip.__del__ of <moviepy.video.io.VideoFileClip.VideoFileClip 
instance at 0x7f6b8b6b9830>> ignored

Code:

 clip = (VideoFileClip("tmp.flv", audio=False)
                .subclip(float(start_time_seconds), float(end_time_seconds)))
                .resize(1))

@Zulko
Copy link
Owner

Zulko commented Oct 19, 2014

It works fine on my computer. It's not a filename problem (because that gives a different error) so I'd say it has to do with corrupted files (like, an embryo of a file or something). Can you give more infos ? Like the script that produces the issue (how is the file downloaded ?), a video for which it works and one for which it doesn't. Also what OS are you on, and do you use a recent version of MoviePy ?

@ttback
Copy link
Author

ttback commented Oct 19, 2014

Now that u mention it, the video is downloaded by youtube-dl with format
set to flv. Thinking that file format might be the problem for moviepy. Do
you have any parameters you use to download that video from youtube via
youtube-dl?

On Sunday, October 19, 2014, Zulko notifications@github.com wrote:

It works fine on my computer. It's not a filename problem (because that
gives a different error) so I'd say it has to do with corrupted files
(like, an embryo of a file or something). Can you give more infos ? Like
the script that produces the issue (how is the file downloaded ?), a video
for which it works and one for which it doesn't. Also what OS are you on,
and do you use a recent version of MoviePy ?


Reply to this email directly or view it on GitHub
#82 (comment).

I came, I saw, I wondered.

@Zulko
Copy link
Owner

Zulko commented Oct 19, 2014

Yes I think you can choose the format with youtube-dl (by default it gives you the highest quality it can find). But I don't know how.

I don't think it is the issue. I downloaded the flv using DownloadHelper (because youtube-dl gave me an mp4 by default). It works fine with the flv too. Unless the two flvs (mine and yours) have different internal formats

@Zulko
Copy link
Owner

Zulko commented Oct 19, 2014

... But again: 'no attribute 'reader'" is not a real bug, it is a side-bug trigerred when quitting MoviePy after another bug occured. So I'd really need to see the complete error returned by moviepy.

@ttback
Copy link
Author

ttback commented Oct 19, 2014

@Zulko problem solved...it was silly but somehow subprocess.call() wasn't blocking the execution of youtube-dl command, so moviepy ended up reading the file before it was downloaded, which caused the issue.

@ttback ttback closed this as completed Oct 19, 2014
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