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

list index out of range #5

Open
anotherancientalien opened this issue May 9, 2012 · 5 comments
Open

list index out of range #5

anotherancientalien opened this issue May 9, 2012 · 5 comments

Comments

@anotherancientalien
Copy link

Hi;
VideoFiled uploading video but after uploading I have this error:

Exception Value: list index out of range
Exception Location:/library/videothumbs.py in generate_thumb, line 51

line 51:
for c in range(len(histogram[0])):
ac = 0.0
for i in range(n):
ac = ac + (float(histogram[i][c])/n)
avg.append(ac)

How can I solve the problem?
Thanks in advance

@macmichael01
Copy link
Owner

Could you possibly toss a debug statement in so we can see what histogram contains? Is PIL, ffmpeg properly installed?

@anotherancientalien
Copy link
Author

With print histogram:
[10/May/2012 23:33:06] "POST /admin/streaming/videouploads/add/ HTTP/1.1" 500 159417
dynamic/videos/ ['add', 'class', 'contains', 'delattr', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getitem', 'getnewargs', 'getslice', 'gt', 'hash', 'init', 'le', 'len', 'lt', 'mod', 'mul', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'rmod', 'rmul', 'setattr', 'sizeof', 'str', 'subclasshook', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdecimal', 'isdigit', 'islower', 'isnumeric', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] ['DEFAULT_CHUNK_SIZE', 'class', 'delattr', 'dict', 'doc', 'enter', 'eq', 'exit', 'format', 'getattribute', 'getstate', 'hash', 'init', 'iter', 'len', 'module', 'ne', 'new', 'nonzero', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'unicode', 'weakref', '_committed', '_del_file', '_file', '_get_closed', '_get_file', '_get_path', '_get_size', '_get_url', '_require_file', '_set_file', '_set_size', '_size', 'chunks', 'close', 'closed', 'delete', 'encoding', 'field', 'file', 'fileno', 'flush', 'instance', 'isatty', 'mode', 'multiple_chunks', 'name', 'newlines', 'open', 'path', 'read', 'readinto', 'readline', 'readlines', 'save', 'seek', 'size', 'sizes', 'softspace', 'storage', 'tell', 'truncate', 'url', 'url_125x125', 'url_300x200', 'write', 'writelines', 'xreadlines'] /Users/jasmine/projects/stream/static/dynamic/videos/69792_08_02_SC01_videoplayer_1.125x125.jpg
sh: ffmpeg: command not found

##But ffmpeg in istalled:
FFmpeg version CVS, Copyright (c) 2000-2004 Fabrice Bellard
Mac OSX universal build for ffmpegX
configuration: --enable-memalign-hack --enable-mp3lame --enable-gpl --disable-vhook --disable-ffplay --disable-ffserver --enable-a52 --enable-xvid --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb --enable-pthreads --enable-x264
libavutil version: 49.0.0
libavcodec version: 51.9.0
libavformat version: 50.4.0
built on Apr 15 2006 04:58:19, gcc: 4.0.1 (Apple Computer, Inc. build 5250)
usage: ffmpeg [[infile options] -i infile]... {[outfile options] outfile}...
Hyper fast Audio and Video encoder
.
.
Thanks

@macmichael01
Copy link
Owner

try running ffmpeg from a terminal. If you receive this message 'sh: ffmpeg: command not found' or similar then you will need to create a symlink (or copy the binary) from the ffmpegx application folder. Since ffmpegx is a GUI, it does not install the ffmpeg commandline tool by default.

Try this:
sudo ln -s /Applications/ffmpegX.app/Contents/Resources/ffmpeg /usr/local/bin/
sudo chown root:wheel /usr/local/bin/ffmpeg
sudo chmod 755 /usr/local/bin/ffmpeg

@macmichael01
Copy link
Owner

FYI: videothumbs is now wrapped within a package installer and is available via Python's Package Index. Cheers!

@anotherancientalien
Copy link
Author

Thanks for great Plugin.
This upload the video but thumbnail is empty. thumnail folder has permissions for write.

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