Skip to content

Instantly share code, notes, and snippets.

View spolo96's full-sized avatar
🎯
Focusing

Samuel Polo Peña spolo96

🎯
Focusing
View GitHub Profile
@spolo96
spolo96 / compress_video.py
Created May 26, 2022 21:20 — forked from ESWZY/compress_video.py
An example Python code for compressing video file to target size.
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='1'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
:param two_pass: Set to True to enable two-pass calculation.
:param filename_suffix: Add a suffix for new video.
@spolo96
spolo96 / soccer_cuts.py
Created March 29, 2021 03:48 — forked from Zulko/soccer_cuts.py
A python script to automatically summarize soccer videos based on the crowd's reactions
#
# This Python script makes a summary of a football game by cutting
# the video around the 10 % loudest moments, which generally
# include the goals and other important events.
# For more details, see this blog post:
# http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/
#
# LICENCE: Creative Commons 0 - Public Domain
# I, the author of this script, wave any rights and place this work in the public domain.
#