简体   繁体   中英

FFMPEG::Error on Uploading Video to production

I am currently developing an app which involves uploading video to the server. The video is on .MOV format since it comes from an iOS Device. I have set-up FFMPEG on the server already. But everytime I try to upload a video, an FFMPEG error comes out:

FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers built on Oct 26 2015 08:48:47 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-gpl --enable-version3 --enable-shared --enable-nonfree --enable-postproc libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/deploy/production/pinoymobiledirectory-ws/public/uploads/tmp/20151029-0424-12438-7062/tmpfile': Metadata: major_brand : qt minor_version : 0 compatible_brands: qt creation_time : 2015-10-29 04:24:11 Duration: 00:00:05.38, start: 0.000000, bitrate: 784 kb/s Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s Metadata: creation_time : 2 015-10-29 04:24:11 handler_name : Core Media Data Handler Stream #0:1(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 480x360, 715 kb/s, 30.11 fps, 29.97 tbr, 600 tbn, 1200 tbc Metadata: rotate : 90 creation_time : 2015-10-29 04:24:11 handler_name : Core Media Data Handler [aac @ 0x143c980] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it. ):

lib/carrierwave/ffmpeg.rb:19:in encode_video' app/controllers/v1/businesses_assets_controller.rb:33:in upload_video'

Anyone who also got the same error as mine? How did you solved it?

The key part of the message is 'The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it'.

You need to add this flag to your ffmpeg command. For example the following command, which will compress an mp4 video, contains this flag:

ffmpeg -i BigBuckBunny_320x180.mp4 -strict experimental -acodec aac CompressedBBB_320x180_aac.mp4

Fixed it by installing the latest FFMPEG. Followed this guide: https://gist.github.com/xdamman/e4f713c8cd1a389a5917

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM