On Mon 09 Mar 2020 at 19:38:06 (+0100), Jonas Smedegaard wrote: > All that said, you are of course quite welcome to look at my script, and > even critisize it if you like (no doubt there are things in there worthy > of pointing fingers at).
Before I do, I thought I'd try my hand at one myself. Just to see what happens, I downloaded https://www.youtube.com/watch?v=I_rVtFUkMus which has plenty of synchronisation points, and a gradual decrease in volume from start to finish. ffmpeg -i original.mkv -ar 44100 -ac 2 original.wav sox original.wav -t wav -r 44100 -b 16 -c 2 companded.wav compand 0.3,1 6:-70,-60,-20 -15 -90 0.2 gain -n -0.01 ffmpeg -i companded.wav -i original.mkv final.mp4 I couldn't detect any loss of synchronisation (don't watch Barenboim, of course), but the latter half had its volume raised about how I expected. Does this qualify? It seemed too easy. OK, the original's an MKV, as so many of my youtube videos are; perhaps they're easier to pull apart and join together again. I thought the last command would need -an somewhere, but it didn't seem to matter where or whether I put it. The mappings show as in: Stream #1:0 -> #0:0 (h264 (native) -> h264 (libx264)) Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native)) out: Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default) Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s Cheers, David.