I need to transcode an audio file inside an mp4 container from HE AAC to AAC without touching the video file inside so that
1) I'm able to edit the mp4 with both a video AND audio track present in Vegas Pro 13 and
2) so that the quality of the original video file remains intact.
If there is some codec to install so that Vegas can recognize the HE AAC audio files WITHOUT having to transcode, that would really help as well.
What I've done so far:
-used MediaInfo to confirm both a video and audio file are present within the mp4 container
-confirmed mp4 plays video and audio tracks as it should in vlc and windows media players
-determined via MediaInfo that the audio is: 96.0 kb/s, 48.0 Khz/24.0 Khz, 2 channels, ACC (HE-AAC/LC)
-edited an ffmpeg avi bat convert file to test that transcoding would fix the audio problem (it did)
here are the parameters of the ffmpeg bat convert file I used:
This transcoded the file to 128kb/s, 48Khz, 2 channels, AAC (LC) which Vegas recognizes and was able to build peaks so the audio track is now present. However, these settings also re-encode the video file so video quality is lost.for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v libx264 -crf 20 -preset slow -profile:v high -level 4.0 -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "newfiles\%%~na.mp4"
When searching how I might fix this myself, I found this on the FFmpeg site: https://trac.ffmpeg.org/wiki/Encode/AAC
I want to use the settings that will allow
1) the original video file to remain untouched
2) the audio file to be the best quality that can be achieved when going back up to AAC from HE AAC
Here is what I think I should use, but I'm new to all of this...
First, not sure if CBR or VBR would be better in this instance.
If CBR, are these settings good?
(I usually do 192, but thought that might be too high in this case. Also, is there a setting to ensure it stays 48Khz/24Khz? Or does ffmpeg keep a setting unless you tell it to change something?)for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -b:a 128k "newfiles\%%~na.mp4" pause
If VBR, are these settings good?
(4 would bring it to about 128, but maybe I should keep it at 3 for around 96 to reduce noise distortion from missing info?)for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -vbr 4 "newfiles\%%~na.mp4" pause
Also, I saw something about ffmpeg needing to be configured with enable --enable-libfdk-aac (and additionally --enable-nonfree if you're also using --enable-gpl. Is that something I would include in the batch file and if so, how?
These are the solutions I thought of, but please let me know if there's another way that might be better, quicker, or easier.
Any help is greatly appreciated!
EDIT: I guess I can't use libfdk_aac with regular ffmpeg and don't have enough time to compile my own. So, would the native AAC encoder work instead?
+ Reply to Thread
Results 1 to 2 of 2
Last edited by trueblueCj; 1st Jul 2018 at 19:33.
https://github.com/jb-alvarado/media-autobuild_suite - it is highly automatic - just follow interactive configurer and you should quickly get your own ffmpeg.