VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. For whatever reason, EVERY example script I have found has failed horribly. JS, BAT, PY every single one of them. I don't even have the first clue how people are getting the damned program to save JS files.... Why can't anyone make a tutorial for JS and PY illiterates? I don't even have the first clue on what I am doing. I've been trying everything I can find on the net for the last 4 days. The only reliable method is doing each and every file individually which means I can do nothing besides sit in front of the computer waiting for each file to complete. I am at my wits end here. I've done the --help and all I can do is look at the resulting info and say "yup, those are certainly commands... HTF do I use them?"

    All I want to do is make a batch file so that it will take the video files within a certain folder and just normalize the audio. That's all I want.... Just audio normalization.

    Any help is appreciated. Just please don't link me to the tutorial or wiki..... I've tried those many MANY times and no success.
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Are all the files roughly the same specs? ie. same container, 1 audio track, same compression ?

    If avidemux isn't working out, you can possibly do a batch with ffmpeg / sox
    Quote Quote  
  3. Ya, checked them all with Gspot. Same specs for all of them. I just can't get any command line or batch processing that will do a "one and done" setup. I've seen other people say they've done it but not giving the code they used.
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    post mediainfo (view=>text) of one of the files
    Quote Quote  
  5. Code:
    General
    Complete name                            : E:\Avidemux\Video.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 284 MiB
    Duration                                 : 42mn 35s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 932 Kbps
    Encoded date                             : UTC 2013-06-06 18:04:04
    Tagged date                              : UTC 2013-06-06 18:08:01
    Writing application                      : HandBrake 0.9.8 2012071700
    
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 42mn 35s
    Bit rate                                 : 767 Kbps
    Width                                    : 720 pixels
    Height                                   : 404 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 23.976 fps
    Minimum frame rate                       : 23.974 fps
    Maximum frame rate                       : 90 000.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.110
    Stream size                              : 234 MiB (82%)
    Writing library                          : x264 core 120
    Encoding settings                        : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=6 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                             : UTC 2013-06-06 18:04:04
    Tagged date                              : UTC 2013-06-06 18:08:01
    Color primaries                          : BT.601 NTSC
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.601
    
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 42mn 35s
    Bit rate mode                            : Variable
    Bit rate                                 : 160 Kbps
    Maximum bit rate                         : 202 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 48.7 MiB (17%)
    Encoded date                             : UTC 2013-06-06 18:04:04
    Tagged date                              : UTC 2013-06-06 18:08:00
    Quote Quote  
  6. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    This is example of a batch file. It pipes to sox for the normalization and back to ffmpeg. It's set to normalize to -3dB currently. Change the value to what you want.

    Open notepad in directory of files to be converted. Copy & paste the following, save. Rename the .txt to .bat extension. Double click the .bat file

    All MP4's will be processed in that directory. The video will be stream copied, but the audio will be normalized and re-encoded with libvoaacenc with 192kbps. Change the bitrate if you want. The new files will be in the same directory with the same name, just the "new" added on to the filename, but you can specify an output path, and you can change the filename if you want

    You need ffmpeg and sox. If they are not in the search path (either the same directory or setup as an environment variable) you can change the script to reflect the paths of the .exe files

    Code:
    
    for %%a in ("*.mp4") do ffmpeg -i "%%a" -f sox - | sox -t sox - -c 2 -r 48000 -b 16 --norm=-3 -t wav - | ffmpeg -i - -i "%%a" -map 0:0 -map 1:0 -c:v copy -c:a libvo_aacenc -b:a 192k "%%~na.new.mp4"
    
    pause
    Quote Quote  
  7. Received the following two errors:
    pipe:: Invalid data found when processing input
    Could not write header for output file #0 (incorrect codec parameters ?): Error number -22 occurred
    Quote Quote  
  8. NVM, fixed that problem
    Quote Quote  
  9. Seems to be working, thank you very much for your assistance.
    Quote Quote  
  10. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Cheers

    For the original avidemux issue, did you try asking in the avidemux forum ?
    Quote Quote  
  11. Not yet, but I don't think I need to now thanks to your help.
    Quote Quote