Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ffmpeg : error while re encoding video

Tags:

ffmpeg

I am trying to re-encoding video with ffmpeg, and I am getting this error :

[aac @ 0x3752e40] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

The command and the full output::

/root$ /usr/bin/ffmpeg -i http://website.com/uploads/usr_videos/MVI_05571.mp4  -b:v 500k  -threads 4 -vf scale=-1:144  -b:a 128k http://website.com/uploads/usr_videos/144p_output.mp4
ffmpeg version 2.5.4 Copyright (c) 2000-2015 the FFmpeg developers
built on Feb 18 2015 01:39:38 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: 
libavutil      54. 15.100 / 54. 15.100
libavcodec     56. 13.100 / 56. 13.100
libavformat    56. 15.102 / 56. 15.102
libavdevice    56.  3.100 / 56.  3.100
libavfilter     5.  2.103 /  5.  2.103
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from     'http://website.com/uploads/usr_videos/MVI_05571.mp4':
Metadata:
major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2mp41
encoder         : Lavf54.63.104
Duration: 00:01:48.26, start: 0.023220, bitrate: 7122 kb/s
Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 6990 kb/s, 29 fps, 29 tbr, 14848 tbn, 29 tbc (default)
Metadata:
  handler_name    : VideoHandler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 126 kb/s (default)
Metadata:
  handler_name    : SoundHandler
[aac @ 0x3752e40] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

So Could anyone till me what this error mean and how can I fix it ?
I am using ffmpeg version 2.5 on centOS server.

like image 482
Ashraf Hefny Avatar asked Feb 18 '15 14:02

Ashraf Hefny


2 Answers

The quick fix is to add the option -strict -2 just before the last argument (the name of the output).

There are several different AAC encoders that FFmpeg can use. For the best quality, use the libfdk_aac encoder. Unfortunately the license of libfdk_aac is incompatible with the GPL, which means that the GPL does not permit distribution of an executable derived from both libx264 (GPL) (used for H.264 video encoding) and libfdk_aac (used for AAC audio encoding). Nevertheless this can be a great choice if you build FFmpeg yourself. If your FFmpeg was built with libfdk_aac then you can use it with the option -c:a libfdk_aac before the output file name.

FFmpeg also has an experimental built-in AAC encoder, which has lower quality at a given bitrate but a compatible license. Because it is experimental it is not used by default, but it can be used if you include the option -strict experimental or -strict -2 just before the output file name, to enable experimental codecs.

For further details see the FFmpeg AAC Encoding Guide.

like image 103
mark4o Avatar answered Nov 20 '22 10:11

mark4o


The native FFmpeg AAC encoder (-codec:a aac) is no longer experimental as of 2015-12-05. Use a recent build from the current git master branch and you won't have to use the -strict option.

like image 2
llogan Avatar answered Nov 20 '22 10:11

llogan