This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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. | |
# |