Commit 39489b18 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

add video thumbnail

parent 39a9aa00
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -289,6 +289,21 @@ def make_hls(f: Union[models.File, int], force: bool = False):
            ]

            subprocess.run(ffmpeg_cmd, check=True)
            subprocess.run(
                [
                    "ffmpeg",
                    "-i",
                    f.local_path(),
                    "-frames:v",
                    "1",
                    "-update",
                    "1",
                    "-vf",
                    "scale=1000:1000:force_original_aspect_ratio=decrease,pad=1000:1000:(ow-iw)/2:(oh-ih)/2:black",
                    f"{hls_destination_dir}thumbnail.jpg",
                ],
                check=True,
            )


def make_iiif(f: Union[models.File, int], force: bool = False):