Skip to content
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

Play other path if stream not ready or publisher dissconnected #3333

Open
mohsundiod opened this issue May 7, 2024 · 3 comments
Open

Play other path if stream not ready or publisher dissconnected #3333

mohsundiod opened this issue May 7, 2024 · 3 comments

Comments

@mohsundiod
Copy link

Describe the feature

media server play default file in loop (mp4 or jpeg or other path) if publisher is not ready.

@mohsundiod mohsundiod changed the title Play last frame or default nosignal mp4 file if stream not ready or publisher dissconnected Play other path if stream not ready or publisher dissconnected May 7, 2024
@eravellaSC
Copy link

Have you tried using the runOnNotReady hook in combination with ffmpeg to stream a file?

@mohsundiod
Copy link
Author

tanx, runOnNotReady do it with this config:

paths:
  udp:
    source: udp://238.0.0.1:1234

    runOnReady: ./ffmpeg.exe -i rtsp://localhost:$RTSP_PORT/$MTX_PATH -c:v copy -c:a copy -f rtsp -rtsp_transport tcp rtsp://localhost:$RTSP_PORT/live
    runOnReadyRestart: no

    runOnNotReady: ./ffmpeg.exe -re -f lavfi -i testsrc=size=1280x720:rate=30 -pix_fmt yuv420p -c:v libx264 -preset ultrafast -b:v 600k -f rtsp -rtsp_transport tcp rtsp://localhost:$RTSP_PORT/live

  live:

Problem:
the client dissconnect from server.
can switch stream on the fly?

@eravellaSC
Copy link

Again, you can use a hook: I think runOnDisconnect is what you are looking for.

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

No branches or pull requests

2 participants