mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#5509 and #5591 - Avoiding up-scaling low-res videos


From: irene
Subject: #5509 and #5591 - Avoiding up-scaling low-res videos
Date: Mon, 29 Jun 2020 18:53:34 +0000

Hello dears developers.

We could use cv2 to solve #5509 and #5591 issues.

Into:

mediagoblin/mediagoblin/media_types/video/processing.py

Example:

import cv2


def common_setup(self, resolution=None):

    # ....

    self.dinamic_resolution = []
    self.process_filename = get_process_filename(
        self.entry, self.workbench, self.acceptable_files)

    self.vid = cv2.VideoCapture(self.process_filename)
    self.height = self.vid.get(cv2.CAP_PROP_FRAME_HEIGHT)
    if self.height >= 1080.0:
        self.dinamic_resolution.extend(
            ['480p', '360p', '720p', '1080p'])
    elif self.height >= 720.0:
        self.dinamic_resolution.extend(
            ['480p', '360p', '720p'])
    elif self.height >= 480.0:
        self.dinamic_resolution.extend(
            ['480p', '360p'])
    elif self.height >= 360.0:
        self.dinamic_resolution.extend(
            ['360p'])
    elif self.height >= 240.0:
        self.dinamic_resolution.extend(
            ['240p'])

and then only "dinamic_resolution" would be called to display appropriate 
resolutions for each video, and you would also have to remove 
"available_resolutions = string_list (default = list ('480p', '360p', '720p'))" 
from 
http://git.savannah.gnu.org/cgit/mediagoblin.git/tree/mediagoblin/media_types/video/config_spec.ini#n18

I don't know MediaGoblin well, so I hope they solve those very important 
issues. I am having space problems on my server due to these issues :(

Best regards!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]