2

I have installed x262 library then installed ffmpeg into /var/www/html/GetVideo directory with these commands.

# build and install x264
git clone --depth 1 git://git.videolan.org/x264
cd x264
./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl
make -j 4
sudo make install

# build and make ffmpeg
git clone --depth=1 git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree
make -j4
sudo make install

So, i have a /var/www/html/GetVideo/x264 library and /var/www/html/GetVideo/x264/ffmpeg directories.

Then i have installed libav codecs by

sudo apt-get install libavcodec-extra-54

Then i have tried to change the frame size and frame rate.

ffmpeg -i /var/www/html/GetVideo/video/20180503145826-8849_1080.mp4 -acodec libvo_aacenc -vcodec libx264 -s 1920x1080 -r 60 -strict experimental /var/www/html/GetVideo/video/output.mp4

Although i have installed libav codec i am still getting Unknown encoder 'libvo_aacenc' error. I don't know where am i missing? How can i resize the videos?

  • FFmpeg removed support for this low quality encoder. Use -c:a aac (-acodec aac) instead. See this answer. Additionally, the libavcodec-extra-54 only affects the ffmpeg package from the repository: it does nothing to your compiled ffmpeg. Unrelated, but you did not need --enable-nonfree because you didn't enable any additional non-free components. You don't need -strict experimental either. – llogan May 9 '18 at 19:53
  • @LordNeckbeard I have installed libvo-aacenc0 but still same error. – Tahtakafa May 10 '18 at 9:55
3

FFmpeg no longer supports libvo_aacenc

It is a low quality encoder and could only encode up to two channels. The built-in FFmpeg AAC encoder was improved to the point that libvo_aacenc was no longer needed, so support for libvo_aacenc was removed from FFmpeg.

Use a recent ffmpeg and use the built-in AAC encoder. So instead of -acodec libvo_aacenc use -acodec aac (or -c:a aac).

You can't just install codecs and assume ffmpeg can use them

Installing libavcodec-extra-54 will not do anything if you want to compile ffmpeg. When compiling, to add support for external codec libraries, you need to:

  1. Install the relevant -dev packages. For example libx264-dev for H.264 video encoding.
  2. Use the appropriate ./configure option to enable it in ffmpeg, such as --enable-libx264. See ./configure --help for a list of supported external codec libraries.
  3. Compile ffmpeg.

If you want to compile see FFmpeg Wiki: Compile for Ubuntu for a step-by-step guide.

However, installing libavcodec-extra-54 will add additional codecs to ffmpeg from the repository (which additional codecs I am not sure anymore).

Why are you compiling?

ffmpeg is available in the Ubuntu repository. Why not just use that?

sudo apt-get install ffmpeg

If there are missing features you can consider compiling.

How can I resize the videos?

Now to address your actual goal. By "resize" I assume you want to scale the video. Here's a simple example using the scale filter:

ffmpeg -i input.mp4 -c:v libx264 -c:a copy -vf scale=1920:1080 output.mp4

In this example the audio is being stream copied because input and output are both MP4, and the audio is likely already AAC, so just copy it instead of re-encoding.

  • I have added setdar=16/9 in your code and its solved. Thank you for detailed explanation. – Tahtakafa May 11 '18 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.