Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Last active April 28, 2019 11:16
Show Gist options
  • Save oberhamsi/f05efe42bbec059d57e90b61bc8b0c52 to your computer and use it in GitHub Desktop.
Save oberhamsi/f05efe42bbec059d57e90b61bc8b0c52 to your computer and use it in GitHub Desktop.
hls encoder for no-audio analog-source video low resolution
#!/bin/bash
# https://ffmpeg.org/ffmpeg-formats.html#Options-5
AVIN="$1"
OUTNAME="$2"
mkdir $OUTNAME
ffmpeg -i $AVIN \
-an \
-c:v libx264 -profile:v main -level 4.1 -pix_fmt yuv420p \
-preset veryslow \
-crf 20 -g 48 -keyint_min 48 -sc_threshold 0 \
-b:v 2500k -maxrate 3200k -bufsize 3750k \
-hls_time 10 -hls_list_size 0\
-hls_segment_filename $OUTNAME/%03d.ts \
$OUTNAME/index.m3u8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment