-
-
Save anonymous/f5c824696e9213025fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EXTM3U | |
#EXT-X-STREAM-INF:BANDWIDTH=64000,CODECS="mp4a.40.5" | |
ts/64k-audio.m3u8 | |
#EXT-X-STREAM-INF:BANDWIDTH=264000,RESOLUTION=400x300,CODECS="avc1.42E01F,mp4a.40.2" | |
ts/264k-400x300.m3u8 | |
#EXT-X-STREAM-INF:BANDWIDTH=728000,RESOLUTION=640x480,CODECS="avc1.42E01F,mp4a.40.2" | |
ts/728k-640x480.m3u8 | |
#EXT-X-STREAM-INF:BANDWIDTH=1628000,RESOLUTION=640x480,CODECS="avc1.42E01F,mp4a.40.2" | |
ts/1628k-640x480.m3u8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
rm -rf ts | |
mkdir ts | |
nohup python -m SimpleHTTPServer 8090 >> /tmp/nohup.log 2>&1 & | |
http_pid=$! | |
trap "kill -9 $http_pid" SIGINT SIGTERM | |
ffmpeg -i input.mp4 -vn -b:a 56k -ar 44100 -ac 2 -c:a libfdk_aac -profile:a aac_he_v2 -hls_time 10 -hls_list_size 0 ts/64k-audio.m3u8 \ | |
-s 400x300 -c:v libx264 -preset:v medium -level:v 3.0 -profile:v baseline -b:v 160k -minrate 160k -maxrate 160k -framerate 12 -b:a 64k -ar 44100 -ac 2 -c:a libfdk_aac -profile:a aac_he_v2 -hls_time 10 -hls_list_size 0 ts/264k-400x300.m3u8 \ | |
-s 640x480 -c:v libx264 -preset:v medium -level:v 3.1 -profile:v main -b:v 540k -minrate 540k -maxrate 540k -framerate 29.97 -b:a 128k -ar 44100 -ac 2 -c:a libfdk_aac -profile:a aac_he_v2 -hls_time 10 -hls_list_size 0 ts/728k-640x480.m3u8 \ | |
-s 640x480 -c:v libx264 -preset:v medium -level:v 3.1 -profile:v main -b:v 1350k -minrate 1350k -maxrate 1350k -framerate 29.97 -b:a 128k -ar 44100 -ac 2 -c:a libfdk_aac -profile:a aac_he_v2 -hls_time 10 -hls_list_size 0 ts/1628k-640x480.m3u8 | |
mediastreamvalidator http://localhost:8090/hls.m3u8 | |
kill -9 $http_pid | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment