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"
pause
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 18:33.
-
I would prefer quality (VBR) over CBR - CBR mode is recommended for native (ffmpeg) AAC encoder.
This is not so easy - you need to compile ffmpeg with support 'libfdk-aac' - such binary can't be distributed as libfdk-aac license condition prevent binary distribution - this should be not a problem (compile own ffmpeg). I've compiled in past ffmpeg with with help of this package - https://github.com/jb-alvarado/media-autobuild_suite - it is highly automatic - just follow interactive configurer and you should quickly get your own ffmpeg.
Similar Threads
-
convert AC3 audio in my MP4 videos to AAC
By njitgrad in forum AudioReplies: 13Last Post: 4th Feb 2018, 16:08 -
How do I use FFmpeg to convert H.264/AAC to H.263/MP3 in .MP4 container?
By Gary_G in forum Video ConversionReplies: 18Last Post: 25th Dec 2016, 16:40 -
FFmpeg error trying to convert audio in mp4
By Thunderhead2772 in forum Video ConversionReplies: 4Last Post: 30th Jan 2015, 09:24 -
FFmpeg's MP4 is not AAC?
By Djard in forum AudioReplies: 8Last Post: 20th Oct 2014, 19:53 -
how can i mux to mp4 from h264/aac using ffmpeg
By DKhanh in forum Video ConversionReplies: 3Last Post: 24th Aug 2013, 11:50