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

Add a way to set the encryption key static #498

Open
dgagn opened this issue Aug 30, 2023 · 1 comment
Open

Add a way to set the encryption key static #498

dgagn opened this issue Aug 30, 2023 · 1 comment

Comments

@dgagn
Copy link

dgagn commented Aug 30, 2023

Instead of dynamic hls, why isn't there options for static? It will greatly improve this package as all the parts can be served with nginx.
Something like :

        FFMpeg::fromDisk('uploads')
            ->open("{$this->argument('video')}.mp4")
            ->exportForHLS()
            ->addFormat($lowFormat, function (HLSVideoFilters $filters) {
                $filters->resize(1280, 720);
            })
            ->setKeyUrlResolver(function ($key) {
                return ...;
            })
            ->addFormat($midFormat, function (HLSVideoFilters $filters) {
                $filters->resize(1920, 1080);
            })
            ->addFormat($highFormat, function (HLSVideoFilters $filters) {
                // this will keep the original resolution but convert with higher bitrate
            })
            ->withRotatingEncryptionKey(function ($filename, $contents) {
                Storage::disk('secrets')->put($filename, $contents);
            }, 30)
            ->onProgress(function ($progress) {
                $this->info("Progress: {$progress}%");
            })
            ->toDisk('public')
            ->save("videos/{$this->argument('video')}.m3u8");
@dgagn
Copy link
Author

dgagn commented Aug 30, 2023

I can create a PR if needed

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