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

How to take incoming stream to pipe to s3 mounted dir? #1728

Open
lovgrandma opened this issue Jun 17, 2023 · 0 comments
Open

How to take incoming stream to pipe to s3 mounted dir? #1728

lovgrandma opened this issue Jun 17, 2023 · 0 comments

Comments

@lovgrandma
Copy link

I have an s3 mounted directory at /home/s3fs/customer and I am trying to pipe incoming rtmp streams with ffmpeg commands to that directory but I cannot seem to do it after publish.

I have a setup where the user always uses the same streamkey and then my on_publish will return the most recent stream record that has been created so they dont always have to change their streamkey for each new stream.

It goes to golang server and redirects in first on_publish to the /stream application. Then to make sure no one just randomly streams to /stream there is another publish. I imagine i can set this all in /live but I was unsure how to set variables in response from golang.

For some reason it goes to next on publish request and i respond with http.statusOK but the actual stream never goes through and pipes to exec directive. How do i leverage those arguments and pipe to ffmpeg command?

All I see is "PUBLISH" in nginx but no actual stream piping through.

rtmp {
    server {
        listen 1935;

        application live {
                live on;
                exec_options on;

                # Livestream Authentication Subrequest
                on_publish http://<auth_domain>/stream/publish;

        }

        application stream {
                live on;
                exec_options on;

                # Livestream Authentication Subrequest
                on_publish <auth_domain>/stream/ingest;
                exec ffmpeg -i rtmp://localhost/src/$arg_input -c:v copy -map 0 -f hls -hls_time 3 -hls_list_size 5 -hls_segment_filename /home/s3fs/$arg_bucket/$arg_key-segment_%03d.ts /home/s3fs/$arg_bucket/$arg_key-playlist.m3u8;
        }
    }
}
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

1 participant