VideoHelp Forum
+ Reply to Thread
Page 7 of 7
FirstFirst ... 5 6 7
Results 181 to 199 of 199
Thread
  1. No , the reason for the cutoff is ffmpeg's AAC encoders tend have a low frequency cutoff at default, like 16000 or something. For high quality audio, you want no cutoff (basically 22000 is no cut off, humans can't hear it)

    -cutoff is the lowpass in Hz . Frequences above that level are "cut off"

    To pipe ffmpeg to nero, the basic syntax for stereo AAC, 320kbps is

    Code:
    ffmpeg -i "input.ext" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | neroAacEnc -if - -br 320000 -ignorelength -of "output.aac"
    So just change your paths & filenames
    Quote Quote  
  2. Actually with Nero, you can use quality based encoding . Instead of -br 320000, you can use -q 1 which is the highest quality/bitrate available for Nero . It should give ~ 400-500kbps on typical sources . Of you can stick to bitrate based if you don't want the audio files to be to big (or even a lower q, q can go from 0 to 1, so you might use 0.5 etc...)
    Quote Quote  
  3. Will the Q1 still be variable bitrate?

    Here's the old batch script:

    Code:
    for %%a in ("*.ts") do (
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -map 0:0 -map 0:1 -c:v copy -an "E:\2 = New\Temp\copy.m2v" -vn -c:a libvo_aacenc -b:a 320k -cutoff 22000 -absf aac_adtstoasc "E:\2 = New\Temp\gain.m4a"
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\gain.m4a"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\gain.m4a" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\128kbps_ac3.ac3"
    
    "X:\Portable Installations\MJPEG Tools\bin\mplex.exe" -o "%%~da%%~pa%%~na.AC3.mpg" "E:\2 = New\Temp\copy.m2v" "E:\2 = New\Temp\128kbps_ac3.ac3" -f 3 
    
    del "E:\2 = New\Temp\copy.m2v"
    del "E:\2 = New\Temp\128kbps_ac3.ac3"
    del "E:\2 = New\Temp\gain.m4a"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause

    Where does this NeroAAC line fit in with the rest of the script?:


    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -br 320000 -ignorelength -of "E:\2 = New\Temp\output.aac"
    Quote Quote  
  4. You don't audio processed in the 1st line anymore, since you've abandoned libvo_aacenc

    You need a separate line piping ffmpeg to neroaac to encode a new aac, the one you have at the end of the reply above. That new aac file (currently called "output.aac") is what you plug into aacgain instead of the old gain.m4a which you no longer need

    If you can't figure it out after doing some honest attempts, then ask again You only learn by trying these things out



    For nero, yes -q 1 is still VBR . -br 3200000 is still VBR as well. You can force CBR by using -cbr 320000 (or some bitrate instead)
    Quote Quote  
  5. Tried just the following lines to see if I would give me an AAC file:

    Code:
    for %%a in ("*.ts") do (
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of ""E:\2 = New\Temp\output.aac"
    Script runs fine but no files are created and the CMD doesn't mention any errors.

    Also is that line supposed to demux the video as well or do I do that later?
    Last edited by VideoFanatic; 14th Aug 2014 at 20:43.
    Quote Quote  
  6. You need an end bracket, and you have double open quotes on the output file

    That line is just for audio
    Quote Quote  
  7. OK fixed it and it get an aac file. Don't understand how I can feed an M4A file to AAC Gain or what I'm supposed to do to get the video demuxed.


    Code:
    for %%a in ("*.ts") do (
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of "E:\2 = New\Temp\output.aac" 
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\gain.m4a"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\gain.m4a" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\128kbps_ac3.ac3"
    
    "X:\Portable Installations\MJPEG Tools\bin\mplex.exe" -o "%%~da%%~pa%%~na.AC3.mpg" "E:\2 = New\Temp\copy.m2v" "E:\2 = New\Temp\128kbps_ac3.ac3" -f 3
    
    
    del "E:\2 = New\Temp\copy.m2v"
    del "E:\2 = New\Temp\128kbps_ac3.ac3"
    del "E:\2 = New\Temp\gain.m4a"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    Quote Quote  
  8. To demux the video, use the old command (the 1st line), just edit out the audio part because you're no longer use libvo_aacenc. So the "new" 1st line becomes

    Code:
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -c:v copy -an "E:\2 = New\Temp\copy.m2v"


    Because your "new" nero encoded AAC file is called "output.aac" in that script , you'd have to change the rest of the script to reflect that. "gain.m4a" no longer exists because you're no longer using libvo_aacenc. Basically all instances of "gain.m4a" should be called "output.aac". You can feed the nero encoded "output.aac" to AACGain, it will work fine. Or you can re-arrange them or name them however you want - the main point is you can't call files that don't exist

    If it doesn't make sense, or youdon't want to learn, I can just give you the script - but you should do this step by step so you actually understand what is going on. That way you can fix problems and customize scripts on your own. I think by now you should have a basic understanding of what is going on.
    Quote Quote  
  9. Thanks got it working.

    Here's my MPEG2 script:
    Code:
    for %%a in ("*.ts") do (
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -c:v copy -an "E:\2 = New\Temp\copy.m2v"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of "E:\2 = New\Temp\output.aac" 
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\output.aac"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output.aac" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\128kbps_ac3.ac3"
    
    "X:\Portable Installations\MJPEG Tools\bin\mplex.exe" -o "%%~da%%~pa%%~na.AC3.mpg" "E:\2 = New\Temp\copy.m2v" "E:\2 = New\Temp\128kbps_ac3.ac3" -f 3
    
    
    del "E:\2 = New\Temp\copy.m2v"
    del "E:\2 = New\Temp\128kbps_ac3.ac3"
    del "E:\2 = New\Temp\output.aac"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    Here's my MKV script doing the same thing but for MKV:

    Code:
    for %%a in ("*.mkv") do (
    
    "X:\Portable Installations\MKV Toolnix\mkvextract.exe" --ui-language en tracks "%%a" 0:"E:\2 = New\Temp\video.h264" 1:"E:\2 = New\Temp\output0.ac3" 
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output0.ac3" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of "E:\2 = New\Temp\output.aac" 
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\output.aac"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "E:\2 = New\Temp\output.aac" -map 0:0 -vn -c:a copy "%%~da%%~pa%%~na.aac" -map 0:0 -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\output.ac3"
    
    "X:\Portable Installations\MKV Toolnix\mkvmerge.exe" -o "%%~da%%~pa%%~na.AC3.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\video.h264" ")" "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\output.ac3" ")" "--track-order" "0:0,1:0"
    
    del "E:\2 = New\Temp\video.h264"
    del "E:\2 = New\Temp\output0.ac3"
    del "E:\2 = New\Temp\output.aac"
    del "E:\2 = New\Temp\output.ac3"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    
    )
    
    pause
    Here's my TS script doing the same thing but for TS:

    Code:
    for %%a in ("*.ts") do (
    
    "X:\Portable Installations\eac3to\eac3to.exe" "%%a" 1:"E:\2 = New\Temp\video.h264"
    
    "X:\Portable Installations\ffmpeg\bin\ffmpeg.exe" -i "%%a" -vn -c:a pcm_s16le -ac 2 -ar 48000 -f wav - | "X:\Portable Installations\NeroAACCodec-1.5.1\win32\NeroAACEnc.exe" -if - -q 1 -ignorelength -of "E:\2 = New\Temp\output.aac" 
    
    "X:\Portable Installations\AAC Gain 1.9\aacgain.exe" -r -k -m 0 "E:\2 = New\Temp\output.aac"
    
    "X:\Portable Installations\FFMPEG\bin\ffmpeg.exe"  -i "E:\2 = New\Temp\output.aac" -vn -c:a copy "%%~da%%~pa%%~na.aac" 
    
    "X:\Portable Installations\FFMPEG\bin\ffmpeg.exe"  -i "E:\2 = New\Temp\output.aac" -vn -c:a ac3 -b:a 128k "E:\2 = New\Temp\output.ac3"
    
    "X:\Portable Installations\MKV Toolnix\mkvmerge.exe" -o "%%~da%%~pa%%~na.AC3.mkv" "--forced-track" "0:no" "-d" "0" "-A" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\video.h264" ")" "--language" "0:eng" "--forced-track" "0:no" "-a" "0" "-D" "-S" "-T" "--no-global-tags" "--no-chapters" "(" "E:\2 = New\Temp\output.ac3" ")" "--track-order" "0:0,1:0"
    
    del "E:\2 = New\Temp\output.aac"
    del "E:\2 = New\Temp\video.h264"
    del "E:\2 = New\Temp\output.ac3"
    
    )
    
    "X:\Daves Folder\Sounds\VideoRedo Completed Sound Short.WAV"
    
    pause
    All the scripts work but just wanted to double-check that they look OK to you? Is the underlined portion correct in the MKV script?

    Was wondering as well, why are we not using cutoff 22000 with NeroAACEnc?

    What AC3 encoder is being used and is that the best one I should use?
    Quote Quote  
  10. Looks ok. Wasn't that hard was it ? Now you can customize your scripts to do other things

    NeroAAC doesn't have a "cutoff" switch

    There is only 1 free AC3 encoder, based on aften and you're using it. Quality is good / nothing to be concerned about
    Quote Quote  
  11. Thanks. Noticed something weird. The AAC normalization works fine however for the intro to an episode, AAC Gain may normalize it to different volumes. Clips are HERE.

    It's no big deal and won't stop me from using AAC gain but any idea why that would happen and is there a way to prevent that happening?
    Quote Quote  
  12. I didn't download your clips, but did you examine the source intros ? Open them up in an audio editor. If they have differences to begin with, the normalization will have different results with any method or algorithm used, not just AACgain . All it takes is one data point sample spike and you can get completely different results
    Quote Quote  
  13. I don't have the source AAC anymore as they were normalized by AAC Gain. They were recorded off satellite TV with the Elgato Game Capture HD. The Elgato doesn't let you change the recording volume so the volume must have been whatever it was broadcast like. I then normalized them with the same AAC Gain script.

    I thought the whole idea of this was that AAC Gain would normalize everything to the same volume at about -3dB? Can't remember if that was the exact figure but you get what I'm trying to say.
    Quote Quote  
  14. Originally Posted by VideoFanatic View Post
    I don't have the source AAC anymore as they were normalized by AAC Gain. They were recorded off satellite TV with the Elgato Game Capture HD. The Elgato doesn't let you change the recording volume so the volume must have been whatever it was broadcast like. I then normalized them with the same AAC Gain script.

    I thought the whole idea of this was that AAC Gain would normalize everything to the same volume at about -3dB? Can't remember if that was the exact figure but you get what I'm trying to say.

    Yes, if the original broadcast have 1 audio sample that was higher than the max of the other, that will affect the normalization

    It's normalizing , but limiting to the max value at -3dB, to prevent clipping . So if audio "clip A" and "clip B" are 99.9999999999% identical, but clip A has a max value of -10db, clip B is the same except 1 tiny audio sample that is at -4dB, you will get different gain values applied.

    You're not normalizing accross different videos - each video in the batch won't end up with the same average volume. You're normalizing within each individual video, but that is limited by each individual video's original max dB value
    Quote Quote  
  15. I've got a weird problem. I've got 2 clips for you:

    Raw 2014 Sep 22 clip source

    Raw 2014 Sep 22 clip after MeGUI (out of sync at 2 mins 20 secs)

    The MeGUI re-encoded 2 hour 20 minute video the MeGUI clip is from is out of sync by about 1 second. It doesn't mention any delay in MediaInfo (although the MeGUI clip does, it says 200ms delay).

    MediaInfo on the Source says there's a -80ms delay but everything is in sync. Source was recorded with Elgato Game Capture HD, edited in VideoRedo (still had the delay), then I used your script HERE to mux back to MKV & convert the AAC to AC3 and normalize (still had the delay after that). I don't believe it's the Elgato causing the delay as 99% of the time my recordings don't have any delay before or after MeGUI is used to re-encode them). Is it something going on in MeGUI which causes this issue?

    Your first version of the script didn't demux the video, it only converted the AAC to AC3 and remuxed. That caused a huge 1 minute delay. So we used the present version of your script which demuxed both the video and audio before doing everything else. No more sync problems after that until today!

    Trying to Fix the MeGUI Out of Sync file

    I tried demuxing the MeGUI file and remuxing but it was still out of sync (that was how I fixed my source videos a long time ago which used your first version of the script). I tried demuxing the video of the MeGUI file and remuxing with the audio of the source (source was in sync) but it was still out of sync.

    It's bizarre because to test if the problem was in the source, I demuxed the source with TSMuxer then remuxed it and it was still in sync and also there was no delay mentioned in MediaInfo! (I also then used MeGUI on that file and it was still in sync). So why when I manually demux and remux there's no delay reported but when I use your script to do the same thing, it adds the delay which seems to cause the problem with MeGUI?

    How can I prevent your script from passing the delay present in the source to the remuxed video that the script makes?
    Quote Quote  
  16. Originally Posted by VideoFanatic View Post
    I've got a weird problem. I've got 2 clips for you:

    Raw 2014 Sep 22 clip source

    Raw 2014 Sep 22 clip after MeGUI (out of sync at 2 mins 20 secs)

    The MeGUI re-encoded 2 hour 20 minute video the MeGUI clip is from is out of sync by about 1 second. It doesn't mention any delay in MediaInfo (although the MeGUI clip does, it says 200ms delay).

    MediaInfo on the Source says there's a -80ms delay but everything is in sync. Source was recorded with Elgato Game Capture HD, edited in VideoRedo (still had the delay), then I used your script HERE to mux back to MKV & convert the AAC to AC3 and normalize (still had the delay after that). I don't believe it's the Elgato causing the delay as 99% of the time my recordings don't have any delay before or after MeGUI is used to re-encode them). Is it something going on in MeGUI which causes this issue?

    Your first version of the script didn't demux the video, it only converted the AAC to AC3 and remuxed. That caused a huge 1 minute delay. So we used the present version of your script which demuxed both the video and audio before doing everything else. No more sync problems after that until today!

    Trying to Fix the MeGUI Out of Sync file

    I tried demuxing the MeGUI file and remuxing but it was still out of sync (that was how I fixed my source videos a long time ago which used your first version of the script). I tried demuxing the video of the MeGUI file and remuxing with the audio of the source (source was in sync) but it was still out of sync.

    It's bizarre because to test if the problem was in the source, I demuxed the source with TSMuxer then remuxed it and it was still in sync and also there was no delay mentioned in MediaInfo! (I also then used MeGUI on that file and it was still in sync). So why when I manually demux and remux there's no delay reported but when I use your script to do the same thing, it adds the delay which seems to cause the problem with MeGUI?

    How can I prevent your script from passing the delay present in the source to the remuxed video that the script makes?

    Did you try demuxing / remuxing the videoredo edited file, or the original source with tsmuxer ? Or is the "source" you're referring to the videoredo edited file ?
    Quote Quote  
  17. I don't have time this weekend to help you with this, but if demuxing whatever "file" (either the source or videoredo file) with tsmuxer works, why don't you use tsmuxer in the batch ?
    Quote Quote  
  18. ..
    Last edited by VideoFanatic; 29th Sep 2014 at 08:32.
    Quote Quote  
  19. Source I was referring to in the last 2 paragraphs of my post was the video I had after I used your script on it. It seems to be MKVMerge that's the issue as for some reason even though MKVMerge is remuxing files it still adds the -80ms delay yet TSMuxer does not. It looks like there's no way to prevent MKVMerge from adding a delay.

    I can give TSmuxer a try but I've no idea what script I should use for that? HERE is your script which uses MKVMerge to remux at the end. Could you please tell me what script I should use to use TSMuxer to Mux to TS instead?
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!