Save frame to target file without prompt

This commit is contained in:
Romain Neutron 2013-08-06 14:59:28 +02:00
commit aa26a1efd0
3 changed files with 5 additions and 4 deletions

View file

@ -5,6 +5,7 @@ CHANGELOG
* Allow use of FFProbe on remote URIs. * Allow use of FFProbe on remote URIs.
* Fix #47 : MediaTypeInterface::save adds filters depending on the codec. * Fix #47 : MediaTypeInterface::save adds filters depending on the codec.
* Save frame to target file without prompt.
* 0.3.0 (07-04-2013) * 0.3.0 (07-04-2013)

View file

@ -80,14 +80,14 @@ class Frame extends AbstractMediaType
*/ */
if (!$accurate) { if (!$accurate) {
$commands = array( $commands = array(
'-ss', (string) $this->timecode, '-y', '-ss', (string) $this->timecode,
'-i', $this->pathfile, '-i', $this->pathfile,
'-vframes', '1', '-vframes', '1',
'-f', 'image2', $pathfile '-f', 'image2', $pathfile
); );
} else { } else {
$commands = array( $commands = array(
'-i', $this->pathfile, '-y', '-i', $this->pathfile,
'-vframes', '1', '-ss', (string) $this->timecode, '-vframes', '1', '-ss', (string) $this->timecode,
'-f', 'image2', $pathfile '-f', 'image2', $pathfile
); );

View file

@ -83,13 +83,13 @@ class FrameTest extends AbstractMediaTestCase
{ {
return array( return array(
array(false, array( array(false, array(
'-ss', 'timecode', '-y', '-ss', 'timecode',
'-i', __FILE__, '-i', __FILE__,
'-vframes', '1', '-vframes', '1',
'-f', 'image2') '-f', 'image2')
), ),
array(true, array( array(true, array(
'-i', __FILE__, '-y', '-i', __FILE__,
'-vframes', '1', '-ss', 'timecode', '-vframes', '1', '-ss', 'timecode',
'-f', 'image2' '-f', 'image2'
)), )),