Closed mzur closed 4 years ago
There is no error handling during extraction of the video codec (here). This can happen if the video is malformed. Implement proper error handling and reject invalid videos.
[2020-04-21 08:47:57] production.ERROR: Unable to probe xxx {"userId":1,"exception":"[object] (FFMpeg\\Exception\\RuntimeException(code: 0): Unable to probe xxx at /var/www/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php:263, Alchemy\\BinaryDriver\\Exception\\ExecutionFailureException(code: 0): ffprobe failed to execute command '/usr/bin/ffprobe' 'xxx' '-show_streams' '-print_format' 'json': Error Output: ffprobe version 4.2.1 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 9.2.0 (Alpine 9.2.0) configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f4d43e90740] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible! [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f4d43e90740] moov atom not found xxx: Invalid data found when processing input at /var/www/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:95) [stacktrace] #0 /var/www/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/FFProbe.php(206): FFMpeg\\FFProbe->probe('https://opensta...', '-show_streams', 'streams') #1 /var/www/vendor/biigle/videos/src/Support/VideoCodecExtractor.php(29): FFMpeg\\FFProbe->streams('https://opensta...') #2 /var/www/vendor/biigle/videos/src/Rules/VideoUrl.php(187): Biigle\\Modules\\Videos\\Support\\VideoCodecExtractor->extract('https://opensta...') #3 /var/www/vendor/biigle/videos/src/Rules/VideoUrl.php(157): Biigle\\Modules\\Videos\\Rules\\VideoUrl->passesCodec('https://opensta...') #4 /var/www/vendor/biigle/videos/src/Rules/VideoUrl.php(69): Biigle\\Modules\\Videos\\Rules\\VideoUrl->passesRemoteUrl('https://opensta...') #5 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(635): Biigle\\Modules\\Videos\\Rules\\VideoUrl->passes('url', 'https://opensta...') #6 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(451): Illuminate\\Validation\\Validator->validateUsingCustomRule('url', 'https://opensta...', Object(Biigle\\Modules\\Videos\\Rules\\VideoUrl)) #7 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(300): Illuminate\\Validation\\Validator->validateAttribute('url', Object(Biigle\\Modules\\Videos\\Rules\\VideoUrl)) #8 /var/www/vendor/laravel/framework/src/Illuminate/Validation/Validator.php(331): Illuminate\\Validation\\Validator->passes() #9 /var/www/vendor/laravel/framework/src/Illuminate/Validation/ValidatesWhenResolvedTrait.php(25): Illuminate\\Validation\\Validator->fails() #10 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Providers/FormRequestServiceProvider.php(30): Illuminate\\Foundation\\Http\\FormRequest->validateResolved() #11 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1102): Illuminate\\Foundation\\Providers\\FormRequestServiceProvider->Illuminate\\Foundation\\Providers\\{closure}(Object(Biigle\\Modules\\Videos\\Http\\Requests\\StoreVideo), Object(Illuminate\\Foundation\\Application)) #12 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\\Container\\Container->fireCallbackArray(Object(Biigle\\Modules\\Videos\\Http\\Requests\\StoreVideo), Array) #13 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(1051): Illuminate\\Container\\Container->fireAfterResolvingCallbacks('Biigle\\\\Modules\\\\...', Object(Biigle\\Modules\\Videos\\Http\\Requests\\StoreVideo)) #14 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(701): Illuminate\\Container\\Container->fireResolvingCallbacks('Biigle\\\\Modules\\\\...', Object(Biigle\\Modules\\Videos\\Http\\Requests\\StoreVideo)) #15 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(785): Illuminate\\Container\\Container->resolve('Biigle\\\\Modules\\\\...', Array, true) #16 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Foundation\\Application->resolve('Biigle\\\\Modules\\\\...', Array) #17 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(770): Illuminate\\Container\\Container->make('Biigle\\\\Modules\\\\...', Array) #18 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(79): Illuminate\\Foundation\\Application->make('Biigle\\\\Modules\\\\...') #19 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(46): Illuminate\\Routing\\ControllerDispatcher->transformDependency(Object(ReflectionParameter), Array) #20 /var/www/vendor/laravel/framework/src/Illuminate/Routing/RouteDependencyResolverTrait.php(27): Illuminate\\Routing\\ControllerDispatcher->resolveMethodDependencies(Array, Object(ReflectionMethod)) #21 /var/www/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(41): Illuminate\\Routing\\ControllerDispatcher->resolveClassMethodDependencies(Array, Object(Biigle\\Modules\\Videos\\Http\\Controllers\\Api\\ProjectVideoController), 'store') #22 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(Biigle\\Modules\\Videos\\Http\\Controllers\\Api\\ProjectVideoController), 'store') #23 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\\Routing\\Route->runController() #24 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\\Routing\\Route->run() #25 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request)) #26 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #27 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #28 /var/www/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #29 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure), 'web', 'api') #30 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(76): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #31 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #32 /var/www/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #33 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #34 /var/www/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #35 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #36 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #37 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #38 /var/www/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #39 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #40 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #41 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #42 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request)) #43 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route)) #44 /var/www/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request)) #45 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request)) #46 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request)) #47 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #48 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #49 /var/www/app/Http/Middleware/UpdateUserActivity.php(28): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #50 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Biigle\\Http\\Middleware\\UpdateUserActivity->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #51 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #52 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #53 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #54 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #55 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #56 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Illuminate\\Http\\Request), Object(Closure)) #57 /var/www/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request)) #58 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\\Pipeline\\Pipeline->then(Object(Closure)) #59 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request)) #60 /var/www/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #61 {main} "}
There is no error handling during extraction of the video codec (here). This can happen if the video is malformed. Implement proper error handling and reject invalid videos.