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

Broken S3FS HLS #5

Open
ingageco opened this issue Jul 8, 2022 · 1 comment
Open

Broken S3FS HLS #5

ingageco opened this issue Jul 8, 2022 · 1 comment

Comments

@ingageco
Copy link

ingageco commented Jul 8, 2022

I've been using this setup for a while, trying to get it ready for production. When generating adaptive HLS via and FFMPEG exec, the HLS ends up broken, streaming OK for a short while, then freezing. It's not a CPU/memory issue, as I've tried it on servers with obscenely high CPU/memory. I've attempted to use DigitalOcean Spaces (where i run the K8s stack), StackPath storage, and Amazon S3 - the issue persists in all 3. I've tried more transcoding, less transcoding, and even letting FFMPEG generate the HLS rather than pushing it into another Nginx-rtmp application. Ive tried switching out s3fs for goofys to no success - nothing solves it.

Any ideas at all what could cause this? Has anyone attempted to use this with Kubernetes at all, with adaptive bitrate HLS generation to S3 success?

@ingageco
Copy link
Author

ingageco commented Jul 8, 2022

`
daemon off;
worker_processes 1;
user root;

error_log /dev/stdout error;

events {
worker_connections 1024;
}

rtmp {
server {
listen 1935;
chunk_size 4000;
application embeds {
live on;

        exec /usr/local/bin/ffmpeg -i rtmp://localhost:1935/embeds/$name
          -c:a libfdk_aac -b:a 128k -c:v libx264 -sc_threshold 0 -b:v 2500k -f flv -s 1280x720 -preset veryfast -profile:v main rtmp://localhost:1935/adaptive/$name_720p2628kbs
          -c:a libfdk_aac -b:a 128k -c:v libx264 -sc_threshold 0 -b:v 1000k -f flv -s 854x480 -preset veryfast -profile:v main rtmp://localhost:1935/adaptive/$name_480p1128kbs
          -c copy -f flv rtmp://localhost:1935/adaptive/$name_src -loglevel verbose 2>>/tmp/ffmpeg.log;

    }

    application adaptive {
        live on;
        hls on;

        hls_fragment_naming sequential;
        hls_fragment_slicing aligned;
        hls_fragment 6;
        hls_playlist_length 36;
        hls_path /opt/data/adaptive;
        hls_nested on;

        hls_variant _src BANDWIDTH=4128000;
        hls_variant _720p2628kbs BANDWIDTH=2628000;
        hls_variant _480p1128kbs BANDWIDTH=1128000;

    }
  
}

}
`

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