diff --git a/docker/Dockerfile b/docker/Dockerfile index 120dc7476..4212746a3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -68,4 +68,6 @@ COPY --from=build /usr/bin/grpc_health_probe /usr/local/bin/grpc_health_probe COPY --from=build /src/tasmodel.pb /tasmodel.pb COPY --from=build /usr/share/misc/pci.ids /usr/share/misc/pci.ids +RUN apt update && apt install net-tools lsof -y + ENTRYPOINT ["/usr/local/bin/livepeer"] diff --git a/media/mediamtx.go b/media/mediamtx.go index 3588519e2..6c1b2f95d 100644 --- a/media/mediamtx.go +++ b/media/mediamtx.go @@ -64,12 +64,14 @@ func (mc *MediaMTXClient) KickInputConnection(ctx context.Context) error { return err } + clog.Infof(ctx, "Sending req to MediaMTX") req, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://%s:%s/v3/%s/kick/%s", mc.host, mediaMTXControlPort, apiPath, mc.sourceID), nil) if err != nil { return fmt.Errorf("failed to create kick request: %w", err) } req.SetBasicAuth(mediaMTXControlUser, mc.apiPassword) resp, err := http.DefaultClient.Do(req) + clog.Infof(ctx, "Done Sending req to MediaMTX") if err != nil { return fmt.Errorf("failed to kick connection: %w", err) } @@ -85,12 +87,14 @@ func (mc *MediaMTXClient) StreamExists() (bool, error) { if err != nil { return false, err } + clog.Infof(context.Background(), "StreamExist: Sending request to MediaMTX, sourceID=%v", mc.sourceID) req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s:%s/v3/%s/get/%s", mc.host, mediaMTXControlPort, apiPath, mc.sourceID), nil) if err != nil { return false, fmt.Errorf("failed to create get stream request: %w", err) } req.SetBasicAuth(mediaMTXControlUser, mc.apiPassword) resp, err := http.DefaultClient.Do(req) + clog.Infof(context.Background(), "StreamExist: Done Sending request to MediaMTX, sourceID=%v", mc.sourceID) if err != nil { return false, fmt.Errorf("failed to get stream: %w", err) } diff --git a/media/rtmp2segment.go b/media/rtmp2segment.go index db1d5a8eb..3467bca74 100644 --- a/media/rtmp2segment.go +++ b/media/rtmp2segment.go @@ -41,6 +41,7 @@ func (ms *MediaSegmenter) RunSegmentation(ctx context.Context, in string, segmen retryCount := 0 for { + clog.Infof(ctx, "Checking if stream exists, sourceID=%v, retryCount=%v", ms.MediaMTXClient.sourceID, retryCount) streamExists, err := ms.MediaMTXClient.StreamExists() if err != nil { clog.Errorf(ctx, "StreamExists check failed. err=%s", err)