0
video = videothumbs.VideoThumbField(upload_to='videos', sizes=((125,125),(300,200),))
在上傳,上傳的視頻,但在創建縮略圖我有這樣的錯誤:
Exception Value: list index out of range Exception Location:/library/videothumbs.py in generate_thumb, line 51
和第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)
視頻檔案有什麼問題?
編輯: 與print histogram
我:
sh: ffmpeg: command not found
但在終端:
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
在此先感謝
不需要檢查長度.. 只是不喜歡它 如果直方圖: 做某事 –
@Nicolae,我已經編輯我的問題。已安裝ffmpeg,但django無法找到。在此先感謝 – TheNone
我沒有Django的videothumbs的知識,我只是注意到,小錯在你的代碼。在我看來,你應該只是做它作爲一個單獨的問題,因爲現在的標題和最初的前提是完全無關的,並刪除了這個問題,或者接受一個答案。 –