Skip to content

Instantly share code, notes, and snippets.

@ESWZY
ESWZY / compress_video.py
Last active April 18, 2024 14:16
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
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.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname