Quick reference for saving an active live stream in the past, and compressing it using FFmpeg on Apple Silicon Macs.
# Record from specific time in past
streamlink --hls-start-offset HH:MM:SS VIMEO_URL best -o output.mp4
# Record from beginning
streamlink --hls-live-restart VIMEO_URL best -o output.mp4
ffmpeg -i input.mp4 -ss START_TIME -to END_TIME -c copy output_trimmed.mp4
# Fast (Hardware Accelerated)
ffmpeg -i input.mp4 -c:v hevc_videotoolbox -q:v 50 -c:a aac -b:a 192k compressed.mp4
# High Quality (Slower)
ffmpeg -i input.mp4 -c:v libx265 -crf 23 -preset slow -c:a aac -b:a 192k archive.mp4
Prameters Explained:
hevc_videotoolbox
: Apple Silicon hardware encoderq:v 50
: Quality setting (0-100, higher is better)crf 23
: Constant Rate Factor (0-51, lower is better)b:a 192k
: Audio bitrate-ss
: Start time-to
: End time-c copy
: Copy stream without re-encoding