1

I'd like to put a watermark to a streaming video with Laravel-ffmpeg repo from Github, but it doesn't recognize its own methods. I've installed the package with composer according to the repo-s readme.md file from here: https://github.com/pascalbaljetmedia/laravel-ffmpeg

I know that there was a similar question here. But nobody answered the question and I've got the method inside the files.

The installation worked properly. And to stream the video I use these codes: https://codesamplez.com/programming/php-html5-video-streaming-tutorial

But when I put the code above to the open() method, Laravel doesn't find the fromDisk method from the FFMpeg.php file.

FFMpeg::fromDisk('videos')
            ->open('steve_howe.mp4')
            ->addFilter($clipFilter)
            ->export()
            ->toDisk('converted_videos')
            ->inFormat(new \FFMpeg\Format\Video\X264)
            ->save('short_steve.mkv');

My composer.json look like this:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "illuminate/config": "5.8.*",
        "illuminate/filesystem": "5.8.*",
        "illuminate/log": "5.8.*",
        "illuminate/support": "5.8.*",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "league/flysystem": "~1.0",
        "pbmedia/laravel-ffmpeg": "^4.0",
        "php-ffmpeg/php-ffmpeg": "^0.13",
        "symfony/process": "~4.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^7.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

How could I say to Laravel that recognize the methods?

Thank you for the help in advance

2 Answers 2

2

For anyone who is using this in 2021 and beyond ...

I used this to import the facade and it worked

use ProtoneMedia\LaravelFFMpeg\Support\FFMpeg;

Sign up to request clarification or add additional context in comments.

1 Comment

This solution was the one that worked for me! Thank you. Perhaps the package documentation needs to be updated...
0

Perhaps you are not using the Laravel package itself and you are calling FFmpeg directly. I just answered the question you mentioned here.

Basically, if you have this: use FFMpeg\FFMpeg; remove it.

1 Comment

Thank you for your answer. Yes we tried this solution but it also hasn't worked. That's why we bypassed this issue and solved with frontend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.