diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index 7054df1a..a5a64525 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -126,8 +126,14 @@ def stream(video, target, profile, info): #'-vf', 'yadif', '-vf', 'hqdn3d,scale=%s:%s'%(width, height), '-g', '%d' % int(fps*5), - '-keyint_min', '%d' % int(fps*2), ] + if format == 'webm': + video_settings += [ + '-deadline', 'good', + '-cpu-used', '0', + '-lag-in-frames', '16', + '-auto-alt-ref', '1', + ] if format == 'mp4': #quicktime does not support bpyramid ''' diff --git a/pandora/archive/models.py b/pandora/archive/models.py index a1308d03..483b32f2 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -5,6 +5,7 @@ from __future__ import division, with_statement import os.path import re import time +import shutil from django.conf import settings from django.contrib.auth.models import User @@ -276,6 +277,11 @@ class File(models.Model): return instance.path return self.path + def delete_frames(self): + frames = os.path.join(settings.MEDIA_ROOT, self.get_path('frames')) + if os.path.exists(frames): + shutil.rmtree(frames) + def delete_file(sender, **kwargs): f = kwargs['instance'] #FIXME: delete streams here diff --git a/pandora/archive/views.py b/pandora/archive/views.py index aefead40..d1b34bad 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -206,6 +206,7 @@ def firefogg_upload(request): f = get_object_or_404(models.File, oshash=oshash) if f.editable(request.user): f.streams.all().delete() + f.delete_frames() f.uploading = True f.save() response = {