I have an Automator script that uses ffmpeg to re-encapsulate a video file into an mp4 container with its audio transcoded to aac while leaving the video as is.
for f in "$@"
do
/Applications/Scriptlets/ffmpeg -i "$f" -c:v copy -c:a aac -b:a 384k -strict -2 "${f%.*}.m4v"
done
This works fine and the resulting video plays well on my system in both iTunes as well as Quick Time Pro; tried it with both avi and mov source files. However, I just noticed that the resulting files have their audio encoded to MPEG-4 HE AAC instead of plain AAC as intended. As a result, even though the file plays well on my Mac, I am unable to play it on my TV which recognizes AAC but not HE-AAC. Any workaround using ffmpeg? Please note that I am not interested in installing yet another encoding/transcoding application for this job. I only want to use ffmpeg so please do not suggest installing anything else.
Best Answer
The problem is your ffmpeg. If telling ffmpeg to use aac causes it to encode in he aac, if that is true, then there is something wrong with your ffmpeg, because specifying aac should never result in he aac. Only telling ffmpeg to encode using libaacplus or libfdk_aac should result in he aac encodes.
Here's an idea... build your own ffmpeg from source, because your binary was built wrong (if what you are saying is true).
You can download the ffmpeg source and build it manually:
But its far easier to install it using package management, like macports:
MacPorts requires an appropriate version of xcode; xcode_5.1.1.dmg is the most recent version for Mavericks (after registerring for a free developer account, and logging into developer.apple.com, that link will begin your xcode download). Once the download completes, open your Terminal.app and complete the installation:
Download and build macports:
MacPorts Guide
add macports to your $PATH:
build your ffmpeg
you can keep everything updated simply with:
If you are unsatisfied and/or need to remove MacPorts: