diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index ae5991d3..88a7e832 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -355,8 +355,8 @@ def frame(video, frame, position, height=128, redo=False, info=None): if redo or not exists(frame): ox.makedirs(folder) if video.endswith('.mp4'): - if settings.USE_MELT: - cmd = melt_frame_cmd(video, frame, position, height, info) + if settings.FFMPEG: + cmd = ffmpeg_frame_cmd(video, frame, position, height) else: cmd = avconv_frame_cmd(video, frame, position, height) else: @@ -377,27 +377,15 @@ def avconv_frame_cmd(video, frame, position, height=128): cmd += [frame] return cmd -def melt_frame_cmd(video, frame, position, height=128, info=None): - if not info: - info = ox.avinfo(video) - fps = float(AspectRatio(info['video'][0]['framerate'])) - position = int(position * fps) - format = frame.split('.')[-1] - vcodec = 'mjpeg' if format == 'jpg' else 'png' +def ffmpeg_frame_cmd(video, frame, position, height=128): cmd = [ - 'melt', - '-silent', - video, - 'in=%d' % position, 'out=%d' % position, - '-consumer', 'avformat:%s' % frame, - 'vcodec=%s' % vcodec, - 'progressive=1' + settings.FFMPEG, '-y', + '-ss', str(position), + '-i', video, + '-an', '-frames:v', '1', + '-vf', 'scale=-1:%s' % height, + frame ] - if height: - dar = AspectRatio(info['video'][0]['display_aspect_ratio']) - width = int(dar * height) - width += width % 2 - cmd += ['s=%sx%s' % (width, height)] return cmd def frame_direct(video, target, position): diff --git a/pandora/settings.py b/pandora/settings.py index 49cb4128..14ae5344 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -152,7 +152,7 @@ LOGGING = { AUTH_PROFILE_MODULE = 'user.UserProfile' AUTH_CHECK_USERNAME = True AVCONV_VERSION = 0 -USE_MELT=False +FFMPEG=False #========================================================================= #Pan.do/ra related settings settings diff --git a/vm/firstboot.sh b/vm/firstboot.sh index 25b47a36..0f162f55 100755 --- a/vm/firstboot.sh +++ b/vm/firstboot.sh @@ -67,7 +67,6 @@ apt-get install -y \ $LIBAVCODEC_EXTRA \ libav-tools \ ffmpeg2theora \ - melt \ mkvtoolnix \ gpac \ imagemagick \