Skip to content

Instantly share code, notes, and snippets.

@MythodeaLoL
Forked from maddox/server.rb
Last active October 17, 2016 18:07
Show Gist options
  • Save MythodeaLoL/178c27e8a4e79e6146884244127e7d3e to your computer and use it in GitHub Desktop.
Save MythodeaLoL/178c27e8a4e79e6146884244127e7d3e to your computer and use it in GitHub Desktop.
ffmpeg Just some experimentation in creating a live transcoding HTTP Live Streaming server for accessing an HDHomeRun
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
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