Last active
April 8, 2018 01:56
-
-
Save maddox/4965331 to your computer and use it in GitHub Desktop.
Just some experimentation in creating a live transcoding HTTP Live Streaming server for accessing an HDHomeRun
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
ffmpeg -i http://PRIMEIP:5004/auto/v1004 -async 1 -ss 00:00:05 -acodec libfdk_aac -vbr 3 \ | |
-b:v \3000k -ac 2 -vcodec libx264 -preset superfast -tune zerolatency -threads 2 -s 1280x720 \ | |
-flags -global_header -map 0:0 -map 0:1 -f segment -segment_time 10 -segment_list stream.m3u8 \ | |
-segment_format mpegts -segment_wrap 10 -segment_list_size 6 -segment_list_flags live stream%03d.ts |
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
require 'rubygems' | |
require 'sinatra' | |
require 'open-uri' | |
get '/test.m3u8' do | |
content_type 'video/MP2T' | |
open('test.m3u8').read | |
end | |
get %r{/(stream\d+.ts)} do | |
content_type 'application/x-mpegURL' | |
open(params[:captures].first).read | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment