Skip to content

Instantly share code, notes, and snippets.

View tuhinpal's full-sized avatar
🎯
Focusing

Tuhin Kanti Pal tuhinpal

🎯
Focusing
View GitHub Profile
@tuhinpal
tuhinpal / refrigerant-calculation.js
Last active June 4, 2022 15:42
Calculate C.O.P. Mass flow rate per ton, Suction volume, Power of a Refrigerant
let t1 = 20; // celcius
let t2 = 45; // celcius
let sgt1 = 2.4167; // eg sg-5°C
let sgt2 = 2.4368;
let cpgt2 = 1.945;
let hgt1 = 613.8;
let hgt2 = 649.31;
let hft2 = 309.68;
let vgt1 = 0.18823;
@tuhinpal
tuhinpal / vod-converter.sh
Last active April 16, 2021 22:23
Convert video to hls
echo "Enter input video path with extension (Ex. input.mp4)"
read input_path
echo "Enter output folder (Ex. output)"
read output_path
mkdir $output_path
ffmpeg -hide_banner -y -i $input_path \
-vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename $output_path/360p_%03d.ts $output_path/360p.m3u8 \
-vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename $output_path/480p_%03d.ts $output_path/480p.m3u8 \