-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AssertionError in ffmpeg_reader.py #14
Comments
Did you update FFMPEG to a recent version from the website as indicated in the README and the documentation ? That might be the issue. |
You are correct, with a more recent version of ffmpeg it works! |
In the next version the program will throw a special warning for Ubuntu/Debian users. I am closing the issue, have fun and let me know if you meet any other problem. |
I got this "error" after trying to create a gif
After installing |
I'm getting an error when creating a gif as well, but it doesn't seem to be an imagemagick issue (I have 6.8.7-7 installed) - it's the same as the original issue
I got the same error with ffmpeg installed from HEAD
|
I got it to work - I wasn't too concerned with losing a few frames, so I hacked in a try/catch for the save_frame call on line 392 of VideoClip.py. I have no idea why it wasn't working, though, so this may still warrant some investigation, or at least a more elegant solution than just silently dropping frames... |
Thanks for the feedback.
|
I don't see that line in VideoClip.py (version 0.2.1.7.09) - I found that line in ffmpeg_reader, though, but it wasn't commented out to begin with? |
Ah... sorry for that, maybe its just the github version. It is difficult to have subprocess working as expected in python 2/3 and That would be really cool if you could do that. Debuging bugs that I Le 05/03/2014 18:47, Joseph Lee a écrit :
|
Hi Zulko, I get this error pretty much every time I try and concatenate videos - it seems to be ffmpeg doesn't fill the pipe at all as the assertion fails after comparing 0 with nbytes. I have tried uncommenting the line you suggested to no avail, as well as running ffmpeg with unbuffered to see if that made a difference. The movies I am trying to concatenate play fine in both QuickTime and VLC. I am currently running on Ubuntu 14.04 with the latest ffmpeg from here. Thanks, Daniel |
Same exact situation as Dhertz for me. |
@kivo360 @Dhertz |
@Zulko No, it still fails this assertion for me unfortunately. |
Ok, I'll look at this later, in the meantime can you paste your code somewhere ? (ideally: could you provide a file(s) with which it fails ?) |
Here is some test code and some movie files: https://www.dropbox.com/s/589rnbt22hsz9j9/moviepy_test.zip Thanks for all your help! |
I have made some tests and I am quite positive that there is a problem with the first input file in your video concatenation. As it seems that many other video files out there have the same problem, I modified the program: now when moviepy has trouble reading a frame (which should only happen at the far end of video files), it prints a warning, and uses the last frame read as a replacement. I tried it on your file and you really can't tell a difference, given the high frame rate. For the details on why I think there is something wrong with your file (the first file of the two you gave me):
In short, you can update you version of moviepy, (hopefully) you won't have this bug, but beware of the repeated-frame-trick that will possibly happen at the end of your file. |
Hmm - I don't think it is just at the end of the file - when I write out the video file once it reports a few errors at the end frames, but I cannot diagnose where these are coming from. The real issue seems to be when concatenating it with other files, it causes hundreds of frames to be lost. If it helps, the video is being recorded and uploaded by iOS devices. |
Just to be sure, did you try it with my last update ? What exactly do you mean by "it causes hundreds of frames to be lost" ? From what I have seen, the problem is just that in a concatenation the program bugs at the end of the first file to be concatenanted (this is the same bug as when you write the file out once), and as a consequence it doesn't write the subsequent files. When the bug at the end of File 1 is solved, the concatenation works properly. With the example files that you provided, the concatenation now works perfectly on my computer, you just loose 1 frame at the end of the first file (this frame is replaced by the frame before). If it were not this situation, could you provide an example (or files) for which this happens ? |
Sorry, you're totally right, that seems to be working now! I was using an old reference to a VideoFileClip after trimming the source material causing it to throw that assertion a lot, which confused matters! Maybe there needs to be an extra check on the number of frames in the file just as to_videofile is called? Now it seems to only drop the last two or so frames, and running through FFMPEG with -c:v h264 seems to fix it! Thanks again for the great library! |
@Dhertz Very cool, thanks for the testing. I am still a little confused as to what causes these problems, maybe in the future someone with real knownledge of ffmpeg/encoding/etc. can help on that matter. I will leave this issue open, at least until @kivo360 can tell me if the new version works for him too. |
@Zulko Thanks for the fast response. I decided on an alternative method to concatenate my videos that doesn't heavily use ffmpeg. It is actually a bit better for my project. So you can know if your patch works well, I'll do some testing later today and let you know of the results. Thanks again. I'll let you know when I have the time to sit down and do it. |
@kivo360 Sure, if you only need to concatenate videos, MoviePy is not the best solution. Thanks, I am closing the issue. |
Yeah, I figured. I'm using it mostly for the video fx, composition and masking components. |
I get this error when trying to use moviepy
(This line)
Python version: 2.7.3
pip freeze: (I installed moviepy via pip)
ffmpeg version
The text was updated successfully, but these errors were encountered: