forked from 0x2620/pandora
remove cached frames
This commit is contained in:
parent
e89c0e30b2
commit
fa05c9d297
3 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
'''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue