TransWikia.com

How to add audio to video using ffmpeg on Linux?

Super User Asked on December 21, 2021

I am able to do this just fine on Mac and Windows, but seem to be getting an error on Linux:

Command Failed: ffmpeg -y -loglevel warning -hide_banner -nostats -strict -2 -i "/home/runner/work/stone/stone/build/mount.quiet.mp4" -i "/home/runner/work/stone/stone/build/crow.wav" -shortest -c:v copy -c:a aac "/home/runner/work/stone/stone/build/mount.crow.mp4"
Guessed Channel Layout for  Input Stream #1.0 : stereo
[aac @ 0xdfa9a0] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

What encoder should I use instead to get this working?

One Answer

Your ffmpeg must be very old to need -strict for AAC encoding. Unfortunately, -hide_banner is hiding the version and other info.

You have two ways to fix this:

  • Option placement matters. You're using -strict as an input option. Move it so it's after the inputs so it is an output option.

  • Update to a modern version and you won't need -strict. I recommend this solution. For Linux yo can download a static build from johnvansickle.com (see FAQ for install instructions).

Answered by llogan on December 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP