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

Support for generating time-lapse video? #923

Open
Indemnity83 opened this issue Apr 2, 2024 · 0 comments
Open

Support for generating time-lapse video? #923

Indemnity83 opened this issue Apr 2, 2024 · 0 comments

Comments

@Indemnity83
Copy link

Indemnity83 commented Apr 2, 2024

Q A
Bug? no
New Feature? no
Version Used v1.2.0
FFmpeg Version v6.1.1
OS MacOS 14.2.1

It may be just not supported, but I'm trying to use PHP-FFMpeg to generate a time-lapse from a series of images. I have a working ffmpeg command to generate the timelapse, but I can't figure out how to map it into code:

ffmpeg -framerate 3 -pattern_type glob -i "image-*.jpeg" output.mp4

I've tried mapping this into a function which uses concat and an array of the image paths instead of the glob pattern, but it (somewhat expectedly) fails.

$snapshotPaths = [
    'image-1.jpeg',
    'image-2.jpeg',
    'image-3.jpeg',
    'image-4.jpeg',
    // ...
];

$ffmpeg = FFMpeg::create();
$video = $ffmpeg->open(array_shift($snapshotPaths));

$video
    ->concat($snapshotPaths)
    ->saveFromDifferentCodecs(new X264(), 'output.mp4');

So again, is this a supported use case that I'm just missing some configs like setting the frame rate?

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