Skip to content

feat: update rtmp target for the fishtank stream #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged

feat: update rtmp target for the fishtank stream #762

merged 1 commit into from
Jun 4, 2025

Conversation

junhyr
Copy link
Collaborator

@junhyr junhyr commented Jun 4, 2025

PR Type

Enhancement


Description

  • Update RTMP_TARGET to new endpoint

  • Add -an flag to disable audio


Changes walkthrough 📝

Relevant files
Configuration changes
entrypoint.sh
Update RTMP target and disable audio                                         

apps/fishtank/entrypoint.sh

  • Updated RTMP_TARGET URL to new RTMP endpoint
  • Added -an flag to ffmpeg invocation
  • +2/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    vercel bot commented Jun 4, 2025

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    pipelines-app 🔄 Building (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 2:39am

    @junhyr junhyr temporarily deployed to Preview - e2e June 4, 2025 02:39 — with GitHub Actions Inactive
    @junhyr junhyr merged commit 4819cfb into main Jun 4, 2025
    5 of 6 checks passed
    @junhyr junhyr deleted the fishtank branch June 4, 2025 02:39
    Copy link

    github-actions bot commented Jun 4, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 Security concerns

    Sensitive information exposure:
    The new RTMP_TARGET contains a streaming key embedded in code. This can lead to unauthorized access; use environment variables or a secret manager instead.

    ⚡ Recommended focus areas for review

    Hardcoded endpoint

    The RTMP_TARGET is hardcoded with a token-like URL; consider sourcing it from an environment variable or a secure configuration to avoid exposing credentials.

    RTMP_TARGET="rtmp://ai.livepeer.monster/stk_m7QQNZPjUp5wP3NV"
    Missing error handling

    The ffmpeg command lacks error logging or retry backoff; failures will silently sleep and retry without visibility. Consider capturing exit codes and logging errors.

    ffmpeg -rw_timeout 10000000 -timeout 10000000 -an -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"

    Copy link

    github-actions bot commented Jun 4, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Check ffmpeg exit status

    Add exit status checking around the ffmpeg command so the loop can break on
    successful completion or log errors with retry logic. This prevents endless rapid
    restarts after unexpected failures.

    apps/fishtank/entrypoint.sh [6-9]

     while true; do
    -  ffmpeg -rw_timeout 10000000 -timeout 10000000 -an -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"
    -  sleep 5
    +  if ffmpeg -rw_timeout 10000000 -timeout 10000000 -an -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"; then
    +    echo "Stream ended successfully"
    +    break
    +  else
    +    echo "ffmpeg exited with code $?; retrying in 5 seconds"
    +    sleep 5
    +  fi
     done
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion adds exit status handling to the ffmpeg loop, improving stability and logging.

    Medium
    General
    Retain audio in output

    Remove the -an flag if audio needs to be preserved, or document its intentional use
    to avoid accidentally dropping audio in the output stream.

    apps/fishtank/entrypoint.sh [7]

    -ffmpeg -rw_timeout 10000000 -timeout 10000000 -an -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"
    +ffmpeg -rw_timeout 10000000 -timeout 10000000 -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"
    Suggestion importance[1-10]: 5

    __

    Why: Removing -an preserves audio, which may be important for use cases, though it depends on requirements.

    Low
    Consolidate timeout flags

    Consolidate timeout settings by removing the redundant -timeout flag if it's not
    supported by the RTMP protocol, or replace it with a protocol-specific option.

    apps/fishtank/entrypoint.sh [7]

    -ffmpeg -rw_timeout 10000000 -timeout 10000000 -an -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"
    +ffmpeg -rw_timeout 10000000 -re -i "$STREAM_URL" -c copy -f flv "$RTMP_TARGET"
    Suggestion importance[1-10]: 4

    __

    Why: Simplifying timeout flags reduces redundancy and clarifies intent without affecting core functionality.

    Low

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant