Permalink
Browse files

add possibility to move moov atom tho the start of the movie for fast…

…er web download
  • Loading branch information...
elvenpath committed Apr 22, 2014
1 parent f735151 commit ef6771027e693b8133310731eb946ed0d9ad8d3d
Showing with 42 additions and 0 deletions.
  1. +42 −0 src/FFMpeg/Filters/PrepareForWebFilter.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @author Vlad Jula-Nedelcu <vlad.nedelcu@gmail.com>
+ */
+namespace FFMpeg\Filters\Video;
+
+use FFMpeg\Format\VideoInterface;
+use FFMpeg\Media\Video;
+
+/**
+ * Prepares the movie for web (pseudo)streaming.
+ * Meaning moving the moov atom to the beginning so it will start faster.
+ */
+class PrepareForWebFilter implements VideoFilterInterface
+{
+ private $priority;
+
+ /**
+ * @inheritdoc
+ */
+ public function __construct($priority = 13)
+ {
+ $this->priority = $priority;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getPriority()
+ {
+ return $this->priority;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function apply(Video $video, VideoInterface $format)
+ {
+ return array('-movflags', '+faststart');
+ }
+}

0 comments on commit ef67710

Please sign in to comment.