|
|
|
@ -28,7 +28,7 @@ import subprocess |
|
|
|
from os.path import splitext |
|
|
|
from os.path import splitext |
|
|
|
|
|
|
|
|
|
|
|
from . import image, utils |
|
|
|
from . import image, utils |
|
|
|
from .settings import Status, get_thumb |
|
|
|
from .settings import Status |
|
|
|
from .utils import is_valid_html5_video |
|
|
|
from .utils import is_valid_html5_video |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -77,6 +77,7 @@ def video_size(source, converter='ffmpeg'): |
|
|
|
x, y = y, x |
|
|
|
x, y = y, x |
|
|
|
return x, y |
|
|
|
return x, y |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_resize_options(source, converter, output_size): |
|
|
|
def get_resize_options(source, converter, output_size): |
|
|
|
"""Figure out resize options for video from src and dst sizes. |
|
|
|
"""Figure out resize options for video from src and dst sizes. |
|
|
|
|
|
|
|
|
|
|
|
@ -152,10 +153,10 @@ def generate_video(source, outname, settings): |
|
|
|
base, dst_ext = splitext(outname) |
|
|
|
base, dst_ext = splitext(outname) |
|
|
|
|
|
|
|
|
|
|
|
if dst_ext == src_ext and not resize_opt and not video_always_convert: |
|
|
|
if dst_ext == src_ext and not resize_opt and not video_always_convert: |
|
|
|
logger.debug('For %s, the source and destination extension are the " \ |
|
|
|
logger.debug('For %s, the source and destination extension are the ' |
|
|
|
"same, there is no resizing to be done, and " \ |
|
|
|
'same, there is no resizing to be done, and ' |
|
|
|
"video_always_convert is False, so the output is " \ |
|
|
|
'video_always_convert is False, so the output is ' |
|
|
|
" being copied', outname) |
|
|
|
' being copied', outname) |
|
|
|
shutil.copy(source, outname) |
|
|
|
shutil.copy(source, outname) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
@ -163,7 +164,7 @@ def generate_video(source, outname, settings): |
|
|
|
if second_pass_options: |
|
|
|
if second_pass_options: |
|
|
|
generate_video_pass(converter, source, final_pass_options) |
|
|
|
generate_video_pass(converter, source, final_pass_options) |
|
|
|
final_second_pass_options = _get_empty_if_none_else_variable( |
|
|
|
final_second_pass_options = _get_empty_if_none_else_variable( |
|
|
|
second_pass_options) + resize_opt |
|
|
|
second_pass_options) + resize_opt |
|
|
|
generate_video_pass(converter, source, |
|
|
|
generate_video_pass(converter, source, |
|
|
|
final_second_pass_options, outname) |
|
|
|
final_second_pass_options, outname) |
|
|
|
else: |
|
|
|
else: |
|
|
|
|