I want to use compand to adjust audio so the low volumes are higher and high volumes are lower, within a reasonable range.
Im NOT an audio filter guru and even pouring though Sox's docs, I dont fully understand what is going on enough to make my own changes.
Id like to re-code DVDs and BDs to have an audio track that I can hear well all lower volume stuff, but wont blow out my speakers during an explosion or gunshot, etc..
What suggestions do you have please?
I am currently toying with the following (because its what I found via Google), it "seams" to work, but Im open to suggestions.
compand=0 0:1 1:-90/-900 -70/-70 -21/-21 0/-15:0.01:12:0:0
Here is the Sox argument I used in another "normalization" project, it worked "pretty good" but Im not sure how to change it to FFMPEG's syntax:
sox audio.wav audio-sox.wav compand 0.3,1 6:-70,-60,-20 -5 -90 0.2
Thanks for any assistance,
Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or try DVDFab and copy, convert or make Blu-rays and DVDs! :)
+ Reply to Thread
Results 1 to 11 of 11
Ahh... I neglected to mention Im running Win32. Sorry.
it's in that thread I posted, cmd line contributed by Selur , the way it is done, you do not pass sox argument but you pass sox output instead, it is called piping, example from that thread adding your compand arguments to get ac3 for example:
ffmpeg -i audio.wav -f sox - | sox -t sox - -b 16 -t sox - compand 0.3,1 6:-70,-60,-20 -5 -90 0.2 | ffmpeg -y -f sox -i - -b:a 192k audio.ac3
you just run two commands one after each other or do both commands at once using BAT file , first get audio-sox.wav and then do something with ffmpeg, like: ffmpeg -y -i audio-sox.wav -b:a 192k audio.ac3
Thank you very much, I will try and digest the information given for better understanding before I ask further questions, your help is greatly appreciated!
-af "aformat=channel_layouts=stereo, compand=0 0:1 1:-90/-900 -70/-70 -30/-9 0/-3:6:0:0:0"
Translation: Audio filter, stereo (forces mono -> stereo, just in case) , compander (compressor/expander), attack 0, release 1,
-90 dB in, infinity out, -70 dB in, -70 dB out, -30 dB in, -9 dB out, 0 dB in, -3 dB out,
soft knee 6, 0 dB makeup gain, input level 0 dB, lookahead 0.
Specifically made for 'whisper+explosion' scenes (personal recipe).
Moving you to our audio forum section.
I know Im doing CPR on an old thread, somehow I missed the recipe that tugshank posted... I revisited just today (10/12/2017!) and saw the update, the formula is working GREAT!
Here is my command line..
ffmpeg_x64 -i "source.mp4" -c:v libx264 -tune film -crf 20 -filter:v hqdn3d -x264opts vbv-bufsize=1100:vbv-maxrate=1100 -preset medium -profile:v high -level:v 4.0 -y -pix_fmt yuv420p -af "aformat=channel_layouts=stereo, compand=0 0:1 1:-90/-900 -70/-70 -30/-9 0/-3:6:0:0:0, volume=6dB" "dest.mp4"
The throttled max 1100kbps is for 720p30 videos that do not need to be pixel peeped, so that bitrate works just fine.
I define as stereo as suggested, run the recipe as issued and boost by 6db because the source audio is a tad low in the videos I am converting.
Ive been using SOX in Avisynth, but sometimes... its just better to let FFMPEG do everything.
Here is the SOX recipe I was using in Avisynth:
soxfilter("compand 0.1,0.3 -90,-90,-70,-55,-50,-35,-31,-31,-21,-21,0,-20 0 0 0.1")
I would have to decode the arguments to figure out how to translate to FFMPEG, when I copy and pasted the above before, it didnt work I suspect the "," were not doing any justice in the audio filter section with FFMPEG.
Anyway, I hope this helps someone who is trying to do similar!