PHP-FFMpeg: extractMultipleFrames creates too many frame images than expected
Q | A |
---|---|
Bug? | Yes |
New Feature? | no |
Version Used | ^0.11.1 |
FFmpeg Version | ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.1.0 (clang-802.0.42) |
OS | OSX 10.33.3 |
Actual Behavior
How does PHP-FFMpeg behave at the moment?
When I use extractMltipleFrames(ExtractMultipleFramesFilter::FRAMERATE_EVERY_60SEC, $dir) using 1 minutes video, I get 1682 images (frameXXXX.jpg) AND for some reason I also get output_XX files. (mentioned in https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/493)
NOTE
For some reason I have to do $video->save($format, $path);
at the end (see full code below). This ends up with frame*.jpg
& output_*.png
while the .png files are irrelevant in this case. Is it by design?
Expected Behavior
What is the behavior you expect?
For 1 minute video I’d expect to have 60 images (1 per second).
Steps to Reproduce
What are the steps to reproduce this bug? Please add code examples, screenshots or links to GitHub repositories that reproduce the problem.
$ composer require php-ffmpeg/php-ffmpeg
$ curl -O https://gist.githubusercontent.com/Shaked/98bd85babc56f3b68605c2165dfc8797/raw/f496d59e2f6f2e1471e8f12aaebde9d4e02f1f53/php-ffmpeg.php
$ php php-ffmpeg.php
$ ls -la /tmp/test_dir
Possible Solutions
If you have already ideas how to solve the issue, add them here. Otherwise remove this section.
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 15 (13 by maintainers)
Commits related to this issue
- implement Simple video format and fix ExtractMultipleFramesFilter https://github.com/PHP-FFMpeg/PHP-FFMpeg/issues/494#issuecomment-371645107 — committed to Shaked/PHP-FFMpeg by Shaked 6 years ago
- refs #494: extract multiple frames — committed to vincenzodibiaggio/PHP-FFMpeg by deleted user 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
- Added possibility to extract images without encoding the video. Fixes #514 and #494 — committed to biozshock/PHP-FFMpeg by biozshock 6 years ago
Yes I will start making one and file a PR this week. Thank you
Ah, okay.
Got it!
We’re setting the output thing twice, so instead of
we should use
Note that we’re only giving it one output stream and perhaps ffmpeg thinks we give two inputs to it.
–
Perhaps you want to fix it? It’s an easy bug after the first look. 😃
Alright, that is very helpful. Thank you! I’m going to investigate, now.
Thank you for the report! Will look into this in the next days, I’m in a hurry atm. Feel free to ping me when I don’t reply until Thursday. 😃