diff --git a/app/Http/Controllers/Views/Videos/VideoController.php b/app/Http/Controllers/Views/Videos/VideoController.php index 6d1fb39ba..10739ef01 100644 --- a/app/Http/Controllers/Views/Videos/VideoController.php +++ b/app/Http/Controllers/Views/Videos/VideoController.php @@ -68,7 +68,6 @@ public function show(Request $request, $id) 'codec' => Video::ERROR_CODEC, 'malformed' => VIDEO::ERROR_MALFORMED, 'too-large' => VIDEO::ERROR_TOO_LARGE, - 'moov-atom' => VIDEO::ERROR_INVALID_MOOV_POS, ]); $fileIds = $volume->orderedFiles()->pluck('uuid', 'id'); diff --git a/app/Jobs/ProcessNewVideo.php b/app/Jobs/ProcessNewVideo.php index 82486917c..41c297c6a 100644 --- a/app/Jobs/ProcessNewVideo.php +++ b/app/Jobs/ProcessNewVideo.php @@ -132,12 +132,6 @@ public function handleFile($file, $path) return; } - if ($this->hasInvalidMoovAtomPosition($path)) { - $this->video->error = Video::ERROR_INVALID_MOOV_POS; - $this->video->save(); - return; - } - $this->video->size = File::size($path); $this->video->duration = $this->getVideoDuration($path); @@ -233,20 +227,6 @@ protected function getVideoDimensions($url) return $this->ffprobe->streams($url)->videos()->first()->getDimensions(); } - protected function hasInvalidMoovAtomPosition($sourcePath) - { - // Webm and mpeg videos don't have a moov atom - if (in_array($this->video->mimeType, ['video/mpeg', 'video/webm'])) { - return false; - } - - $process = Process::forever() - ->run("ffprobe -v trace -i '{$sourcePath}' 2>&1 | grep -o -e type:\'mdat\' -e type:\'moov\'") - ->throw(); - $output = explode("\n", $process->output()); - return !str_contains($output[0], 'moov'); - } - /** * Extract images from video. * diff --git a/app/Video.php b/app/Video.php index bebb988c6..54b582272 100644 --- a/app/Video.php +++ b/app/Video.php @@ -68,13 +68,6 @@ class Video extends VolumeFile */ const ERROR_TOO_LARGE = 5; - /** - * Error if moov atom is not located at beginning. - * - * @var int - */ - const ERROR_INVALID_MOOV_POS = 6; - /** * The attributes that are mass assignable. * diff --git a/resources/assets/js/videos/videoContainer.vue b/resources/assets/js/videos/videoContainer.vue index f8ff76371..4c07d0311 100644 --- a/resources/assets/js/videos/videoContainer.vue +++ b/resources/assets/js/videos/videoContainer.vue @@ -29,7 +29,6 @@ class VideoMimeTypeError extends VideoError {} class VideoCodecError extends VideoError {} class VideoMalformedError extends VideoError {} class VideoTooLargeError extends VideoError {} -class VideoMoovAtomError extends VideoError {} // Used to round and parse the video current time from the URL, as it is stored as an int // there (without decimal dot). @@ -159,9 +158,6 @@ export default { hasTooLargeError() { return this.error instanceof VideoTooLargeError; }, - hasMoovAtomError() { - return this.error instanceof VideoMoovAtomError; - }, errorClass() { if (this.hasVideoError) { if (this.error instanceof VideoNotProcessedError) { @@ -542,8 +538,6 @@ export default { throw new VideoMalformedError(); } else if (video.error === this.errors['too-large']) { throw new VideoTooLargeError(); - } else if (video.error === this.errors['moov-atom']) { - throw new VideoMoovAtomError(); } else if (video.size === null) { throw new VideoNotProcessedError(); } diff --git a/resources/views/manual/index.blade.php b/resources/views/manual/index.blade.php index 8364958c6..75db8e481 100644 --- a/resources/views/manual/index.blade.php +++ b/resources/views/manual/index.blade.php @@ -233,14 +233,6 @@ Advanced configuration of the video annotation tool.
-- Fix errors in video files that can cause problems in BIIGLE. -
-- Fix errors in video files that can cause problems in BIIGLE -
-- To modify the video files, download and install the tool FFmpeg. -
-- The moov atom of an MP4 file is required by the browser to play the video correctly. If the moov atom is placed at the end of the video file, the entire file must be downloaded first before the video can be played. This can be fixed by moving the moov atom to the beginning of the file. -
-- To check the current position of the moov atom in an MP4 file, run the following command. -
-- Linux: -
-ffprobe -v trace -i input.mp4 2>&1 | grep -o -e type:\'mdat\' -e type:\'moov\' -- -
- Windows: -
-ffprobe.exe -v trace -i "input.mp4" 2>&1 | findstr "type:'mdat' type:'moov' -- -
- If type:'moov'
occurs at first in the command output, the video's moov atom position is valid. Otherwise, fix the position with the command below.
-
- Linux: -
-ffmpeg -i input.mp4 -vcodec copy -acodec copy -movflags faststart output.mp4 -- -
- Windows: -
-ffmpeg.exe -i "input.mp4" -vcodec copy -acodec copy -movflags faststart "output.mp4" -- -
- The output.mp4
file will have the moov atom at the correct position.
-