X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=cis%2Fapi%2Fffmpeg.py;h=8e49f1ae79a0afdddbb87403d6f67bb98952f355;hb=66dc2204a919e2c29b2aa9330ea18026d58540d9;hp=27c9a5d0c07849bad8d9cf3f4ebd0102ec134ead;hpb=9d5e17576e133645963b8e41083baf235c5cceba;p=living-lab-site.git diff --git a/cis/api/ffmpeg.py b/cis/api/ffmpeg.py index 27c9a5d..8e49f1a 100644 --- a/cis/api/ffmpeg.py +++ b/cis/api/ffmpeg.py @@ -7,7 +7,7 @@ videos and thumbnail extraction from videos using FFmpeg CLI program. """ import base -import api_exceptions +import cis_exceptions import subprocess import re import os @@ -40,7 +40,7 @@ class FFmpegTranscoder(base.BaseTranscoder): "vp8": "libvpx" } - def _transcode(self, container, a_codec=None, v_codec=None, + def _transcode(self, container, extension=None, a_codec=None, v_codec=None, a_bitrate=None, a_samplingrate=None, a_channels=None, v_bitrate=None, v_framerate=None, v_resolution=None, v_dar=None): @@ -91,7 +91,7 @@ class FFmpegTranscoder(base.BaseTranscoder): exit_code = p.wait() if exit_code > 0: - raise api_exceptions.TranscodingException( \ + raise cis_exceptions.TranscodingException( \ 'FFmpeg exited with code ' + str(exit_code) + '.') log.close() @@ -133,14 +133,14 @@ class FFmpegThumbExtractor(base.BaseThumbExtractor): exit_code = p.wait() if exit_code > 0: - raise api_exceptions.ThumbExtractionException( \ + raise cis_exceptions.ThumbExtractionException( \ 'FFmpeg exited with code ' + str(exit_code) + '.') # FFmpeg bug: when no key frame is found from seek_pos to the # end of file an empty image file is created. if os.path.getsize(output_file) == 0L: os.unlink(output_file) - raise api_exceptions.ThumbExtractionException( \ + raise cis_exceptions.ThumbExtractionException( \ 'FFmpeg created an empty file.') def get_video_duration(self): @@ -194,5 +194,5 @@ class FFprobeAVInfo(base.BaseAVInfo): exit_code = p.wait() if exit_code > 0: - raise api_exceptions.AVInfoException( \ + raise cis_exceptions.AVInfoException( \ 'ffprobe exited with code ' + str(exit_code) + '.')