VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. 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:

    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
    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.

    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?

    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -b:a 128k "newfiles\%%~na.mp4" pause
    (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?)

    If VBR, are these settings good?

    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -vbr 4 "newfiles\%%~na.mp4" pause
    (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?)

    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?
    Last edited by trueblueCj; 1st Jul 2018 at 18:33.
    Quote Quote  
  2. Originally Posted by trueblueCj View Post
    First, not sure if CBR or VBR would be better in this instance.

    If CBR, are these settings good?

    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -b:a 128k "newfiles\%%~na.mp4" pause
    (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?)

    If VBR, are these settings good?

    for %%a in ("*.mp4") do ffmpeg -i "%%a" -c:v copy -c:a libfdk_aac -vbr 4 "newfiles\%%~na.mp4" pause
    (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?)
    I would prefer quality (VBR) over CBR - CBR mode is recommended for native (ffmpeg) AAC encoder.

    Originally Posted by trueblueCj View Post
    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!
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!