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 / automatic_video_concatenation_all_folders.py
Last active September 22, 2022 16:52
A script to automatically traverse each folder containing daily videos (presumably, daily gaming videos) in order to concatenate them into a single video for each folder in order to properly share each video to Youtube, Instagram, Facebook etc.
# Automatic Video Compressor (All Folders Version)
# Script to Traverse Folders and create videos separately.
# Imports
import os
from natsort import natsorted
import glob
import ffmpeg # Remember to install ffmpeg in your PC!
from datetime import date, timedelta
from tqdm import tqdm
@spolo96
spolo96 / automatic_video_compressor.py
Last active May 28, 2022 01:21
A script to automatically compress videos to a desired target size and then concatenates all the compressed videos into a single one in order to properly share it to Youtube, Instagram, Facebook etc.
from natsort import natsorted
import os
import glob
import ffmpeg # Remember to install ffmpeg in your PC!
from datetime import date, timedelta
from tqdm import tqdm
from moviepy.editor import *
VIDEO_PATH = "M:\Videos\Halo The Master Chief Collection" # Path of Desired Videos
@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.
#