Compare commits
4 commits
main
...
transcoder
Author | SHA1 | Date | |
---|---|---|---|
f1a3734d95 | |||
343146d080 | |||
64c07efc39 | |||
98311e3edf |
3 changed files with 5 additions and 27 deletions
|
@ -8,8 +8,6 @@ Uses the std lib http server implementation for the http serving side.
|
||||||
|
|
||||||
**Not intended for actual use**. The stream key use is not secure and is used to handle directories without a user db system, than to provide auth. Same goes for the SRT passphrase. Also just accepts connections so will get DDOS'd immediately.
|
**Not intended for actual use**. The stream key use is not secure and is used to handle directories without a user db system, than to provide auth. Same goes for the SRT passphrase. Also just accepts connections so will get DDOS'd immediately.
|
||||||
|
|
||||||
**Update**: main branch has been tested over a network. RTMP should now work fine, SRT "works" with a few modifications. The RTT ping log-buffer slice must be extended depending on network latency (try ~2x latency/10ms, could adjust automatically, but eh). Also will inevitably crash on poor connections due to the lack of DROPSEQ handling, but will work perfectly fine during the initial 3-10s you get.
|
|
||||||
|
|
||||||
Limits to a single stream at a time, mostly for the lack of db to handle connections and user information rather than concurrency problems.
|
Limits to a single stream at a time, mostly for the lack of db to handle connections and user information rather than concurrency problems.
|
||||||
|
|
||||||
Currently always transcodes to vp9 + opus, segments to fragmented mp4. Creates one segment playlist, no manifest. Uses ffmpeg
|
Currently always transcodes to vp9 + opus, segments to fragmented mp4. Creates one segment playlist, no manifest. Uses ffmpeg
|
||||||
|
|
|
@ -147,12 +147,7 @@ func (agent *SRTManager) process_conclusion(packet *Packet) (*Packet) {
|
||||||
resp_packet := agent.create_conclusion_resp()
|
resp_packet := agent.create_conclusion_resp()
|
||||||
if packet.packet_type == HANDSHAKE {
|
if packet.packet_type == HANDSHAKE {
|
||||||
hs_cif := packet.cif.(*HandshakeCIF)
|
hs_cif := packet.cif.(*HandshakeCIF)
|
||||||
|
if hs_cif.hs_type == 0xffffffff && hs_cif.syn_cookie == agent.syn_cookie {
|
||||||
// allow previous shotgunned induction requests to dissipate
|
|
||||||
if hs_cif.hs_type != 0xffffffff {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if hs_cif.syn_cookie == agent.syn_cookie {
|
|
||||||
for _, v := range hs_cif.hs_extensions {
|
for _, v := range hs_cif.hs_extensions {
|
||||||
// force client to add a stream_id for output location
|
// force client to add a stream_id for output location
|
||||||
// to do: add encryption handling
|
// to do: add encryption handling
|
||||||
|
|
|
@ -8,26 +8,11 @@ import (
|
||||||
|
|
||||||
func NewTranscoder(stream_key string) (io.WriteCloser, error) {
|
func NewTranscoder(stream_key string) (io.WriteCloser, error) {
|
||||||
base_dir, _ := os.UserHomeDir()
|
base_dir, _ := os.UserHomeDir()
|
||||||
command := "ffmpeg"
|
command := "hls-transcoder-2"
|
||||||
command_args := []string{
|
command_args := []string{
|
||||||
"-probesize", "500",
|
"4",
|
||||||
"-i", "pipe:0",
|
"/vid/" + stream_key + "/",
|
||||||
"-c:a", "libopus",
|
"4",
|
||||||
"-c:v", "vp9",
|
|
||||||
"-quality", "realtime",
|
|
||||||
"-speed", "7",
|
|
||||||
"-tile-columns", "4",
|
|
||||||
"-frame-parallel", "1",
|
|
||||||
"-threads", "8",
|
|
||||||
"-b:v", "1M",
|
|
||||||
"-g", "30",
|
|
||||||
"-hls_time", "6",
|
|
||||||
"-hls_list_size", "4",
|
|
||||||
"-hls_base_url", "/vid/" + stream_key + "/",
|
|
||||||
"-hls_segment_type", "fmp4",
|
|
||||||
"-hls_flags", "delete_segments",
|
|
||||||
"-hls_flags", "+program_date_time",
|
|
||||||
"stream.m3u8",
|
|
||||||
}
|
}
|
||||||
transcoder := exec.Command(command, command_args...)
|
transcoder := exec.Command(command, command_args...)
|
||||||
transcoder.Dir = base_dir + "/live/" + stream_key + "/"
|
transcoder.Dir = base_dir + "/live/" + stream_key + "/"
|
||||||
|
|
Loading…
Reference in a new issue