Skip to content

Instantly share code, notes, and snippets.

View jamariya's full-sized avatar

Jamariya jamariya

View GitHub Profile
@jamariya
jamariya / ffmpeg-options.txt
Created May 9, 2024 05:32 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@jamariya
jamariya / ffmpeg.md
Created August 26, 2023 17:36 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@jamariya
jamariya / package.sh
Created July 10, 2023 15:13 — forked from dudewheresmycode/package.sh
Transcode fragmented MP4s and package into HLS and DASH using shaka-packager
#!/bin/bash
packager \
'in=./tmp/output_540p.mp4,stream=video,init_segment=./tmp/output/video_3000_0/video_init.mp4,segment_template=./tmp/output/video_3000_0/video_$Number$.m4s' \
'in=./tmp/output_720p.mp4,stream=video,init_segment=./tmp/output/video_1700_1/video_init.mp4,segment_template=./tmp/output/video_1700_1/video_$Number$.m4s' \
'in=./tmp/output_1080p.mp4,stream=video,init_segment=./tmp/output/video_1200_2/video_init.mp4,segment_template=./tmp/output/video_1200_2/video_$Number$.m4s' \
'in=./tmp/output_audio_128.mp4,stream=audio,language=en,roles=main,hls_name=main_en_2,init_segment=./tmp/output/audio_96_2/audio_init.mp4,segment_template=./tmp/output/audio_96_2/audio_$Number$.m4s' \
'in=./tmp/output_audio_196.mp4,stream=audio,language=en,roles=main,hls_name=main_en_3,init_segment=./tmp/output/audio_64_3/audio_init.mp4,segment_template=./tmp/output/audio_64_3/audio_$Number$.m4s' \
--fragment_duration 6 \
--segment_duration 6 \
@jamariya
jamariya / nginx-tuning.md
Created June 23, 2022 05:49 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],