]> git.parisson.com Git - teleforma.git/commitdiff
fix width
authoryomguy <yomguy@parisson.com>
Wed, 18 Jul 2012 17:04:04 +0000 (19:04 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 18 Jul 2012 17:04:04 +0000 (19:04 +0200)
teleforma/views.py

index 048071841daab26e765d60d5d0dd76b325986d57..60e802f686b899bdcdf3eae8fd8e607562ca0e49 100755 (executable)
@@ -399,8 +399,19 @@ class ConferenceRecordView(FormView):
             stream = LiveStream(conference=self.conference, server=server,
                             stream_type=type, streaming=True)
             stream.save()
+            self.snapshot(stream, station.output_dir)
+
         return super(ConferenceRecordView, self).form_valid(form)
 
+    def snapshot(self, stream, dir):
+        img = urllib2.urlopen(stream.snapshot_url)
+        path = dir + os.sep + 'preview.webp'
+        f = open(path, 'w')
+        f.write(img.read())
+        f.close()
+        command = 'dwepb ' + path + ' -o ' + dir + os.sep + 'preview.png'
+        os.system(command)
+
     @method_decorator(login_required)
     def dispatch(self, *args, **kwargs):
         return super(ConferenceRecordView, self).dispatch(*args, **kwargs)