From aa26a1efd0c0c069cecde799d583b4b054355d51 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 6 Aug 2013 14:59:28 +0200 Subject: [PATCH] Save frame to target file without prompt --- CHANGELOG.md | 1 + src/FFMpeg/Media/Frame.php | 4 ++-- tests/FFMpeg/Tests/Media/FrameTest.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d99f71..151b828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG * Allow use of FFProbe on remote URIs. * Fix #47 : MediaTypeInterface::save adds filters depending on the codec. + * Save frame to target file without prompt. * 0.3.0 (07-04-2013) diff --git a/src/FFMpeg/Media/Frame.php b/src/FFMpeg/Media/Frame.php index 5cbcbeb..bfbed8f 100644 --- a/src/FFMpeg/Media/Frame.php +++ b/src/FFMpeg/Media/Frame.php @@ -80,14 +80,14 @@ class Frame extends AbstractMediaType */ if (!$accurate) { $commands = array( - '-ss', (string) $this->timecode, + '-y', '-ss', (string) $this->timecode, '-i', $this->pathfile, '-vframes', '1', '-f', 'image2', $pathfile ); } else { $commands = array( - '-i', $this->pathfile, + '-y', '-i', $this->pathfile, '-vframes', '1', '-ss', (string) $this->timecode, '-f', 'image2', $pathfile ); diff --git a/tests/FFMpeg/Tests/Media/FrameTest.php b/tests/FFMpeg/Tests/Media/FrameTest.php index ca40d5b..a95df2b 100644 --- a/tests/FFMpeg/Tests/Media/FrameTest.php +++ b/tests/FFMpeg/Tests/Media/FrameTest.php @@ -83,13 +83,13 @@ class FrameTest extends AbstractMediaTestCase { return array( array(false, array( - '-ss', 'timecode', + '-y', '-ss', 'timecode', '-i', __FILE__, '-vframes', '1', '-f', 'image2') ), array(true, array( - '-i', __FILE__, + '-y', '-i', __FILE__, '-vframes', '1', '-ss', 'timecode', '-f', 'image2' )),