From 6fa9f37972b48a945f44376b38c4f9ce0d244b0d Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 7 Mar 2019 19:15:39 +1030 Subject: [PATCH] revid: remove ffmpegSender and any code pertaining to it. --- revid/revid.go | 6 ------ revid/senders.go | 55 ------------------------------------------------ 2 files changed, 61 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index 6944b723..2dad123c 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -219,12 +219,6 @@ func (r *Revid) reset(config Config) error { return err } r.destination = append(r.destination, s) - case FfmpegRtmp: - s, err := newFfmpegSender(config.RtmpUrl, fmt.Sprint(r.config.FrameRate)) - if err != nil { - return err - } - r.destination = append(r.destination, s) case Rtmp: s, err := newRtmpSender(config.RtmpUrl, rtmpConnectionTimeout, rtmpConnectionMaxTries, r.config.Logger.Log) if err != nil { diff --git a/revid/senders.go b/revid/senders.go index c0d4d8e1..b73de1c1 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -30,10 +30,8 @@ package revid import ( "fmt" - "io" "net" "os" - "os/exec" "strconv" "github.com/Comcast/gots/packet" @@ -308,59 +306,6 @@ func (s *httpSender) release() { func (s *httpSender) close() error { return nil } -// ffmpegSender implements loadSender for an FFMPEG RTMP destination. -type ffmpegSender struct { - ffmpeg io.WriteCloser - - chunk *ring.Chunk -} - -func newFfmpegSender(url, framerate string) (*ffmpegSender, error) { - cmd := exec.Command(ffmpegPath, - "-f", "h264", - "-r", framerate, - "-i", "-", - "-f", "lavfi", - "-i", "aevalsrc=0", - "-fflags", "nobuffer", - "-vcodec", "copy", - "-acodec", "aac", - "-map", "0:0", - "-map", "1:0", - "-strict", "experimental", - "-f", "flv", - url, - ) - w, err := cmd.StdinPipe() - if err != nil { - return nil, err - } - err = cmd.Start() - if err != nil { - return nil, err - } - return &ffmpegSender{ffmpeg: w}, nil -} - -func (s *ffmpegSender) load(c *ring.Chunk) error { - s.chunk = c - return nil -} - -func (s *ffmpegSender) send() error { - _, err := s.chunk.WriteTo(s.ffmpeg) - return err -} - -func (s *ffmpegSender) release() { - s.chunk.Close() - s.chunk = nil -} - -func (s *ffmpegSender) close() error { - return s.ffmpeg.Close() -} - // rtmpSender implements loadSender for a native RTMP destination. type rtmpSender struct { conn *rtmp.Conn