-
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
Reading video on Ubuntu 13.10 does not work #8
Comments
Thanks for the feedback. When you say you reinstalled ffmpeg, did you use the binary of the last version on the FFMPEG website ? What format are you video in ? Have you tried different video formats ? Could you try Edit: I don't think the package is Python3 compatible, this is next in my todo list (should not be problematic). |
Output of one example file:
I have tried a few different videos of different formats (.mpg. mp4, .wmv .AVI). |
As you see in last comment, the version that comes with Ubuntu 13.10 is quite old. When I try the latest version from the website it does work. woohoo! Also, when I use -vcodec |
Maybe I should really stress in the docs the importance of downloading FFMPEG from the site (all the Ubuntu/Debian users have this problem). I didn't get you last sentence, what did you mean exactly ? |
In the initialize() method, when I set This could perhaps be a nice fallback, since many Linuxes come with ffmpeg (albeit an old version). |
Ah, I get it. And then convert to raw RBG using PIL for instance. Yes that would be a workaround, but with some inconveniences:
|
Yes, you are right on these points. Also, the png trick now only works for the first frame. Kind of makes sense, since you cannot know beforehand how large the file would be that ffmpeg will stream over the Pipe... it would need some extra work to split the returned bytes and use the remainder for the next image :( would add to code complexity. Perhaps a check on ffmpeg version and give a warning if its < 1? |
That is a good Idea. I don't know how to do that exactly (my version number of FFMPEG is N-58039-gda9d360, it's strange) but I could at least spot the deprecated version of Debuntu and send a warning. Thanks ! |
|
Yup ( Le 29/01/2014 23:03, Almar Klein a écrit :
|
when I use it like this: image = ffmpeg_read_image(filename) |
@rainerfritz Can you paste the entire error message and the entire code you used ? |
Code is here: http://dcs.co.at/files/ffmpeg_read_rgb.py |
This isn't clear in the documentation, but ffmpeg_read_image is for image files (PNG, BMP etc.). It should work for movies too, but it can only get the first frame. It is strange that it doesn't work on your computer, it works on mine (Ubuntu). What is your version of FFMPEG ? Did you download it directly from the website ? To get frames with the FFMPEG reader you do this:
You can also directly import MoviePy:
|
FFMPEG is V2.2 and compiled from the ffmpeg source. OS is Ubuntu 14.04 Code: t = '00:00:00:01' |
Thanks for the nice library. However, I cannot get it to work on any of the video files that I try. I took the ffmpeg_reader.py and ripped out a few small parts to make it standalone.
Tried with Python 2.7 and Python 3.3. Reinstalled ffmpeg to be sure.
I executed:
In all cases the line in read_frame() reads not enough bytes:
s = self.proc.stdout.read(self.depth_w_h)
Now, note that
read()
returns at most the given number of bytes, but any subsequent call to read that I make does not yield any more bytes.Related: Is there a perhaps an example movie on the web which is known to work?
The text was updated successfully, but these errors were encountered: