#2699(avfilter:new): automate lossless normalisation
#2699: automate lossless normalisation -------------------------------------+------------------------------------- Reporter: feelart | Type: Status: new | enhancement Component: avfilter | Priority: normal Keywords: audio | Version: git- lossless normalisation | master Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Introduce a new audio switch to automate LOSSLESS normalisation Propose -a:llnorm CLI example {{{ ffmpeg -i src_audio.aac -a:llnorm out_LOSSLESS_NORMALISED.aac }}} P.S. To best of my knowledge volumedetect, does not 1/ automate normalisation 2/ does NOT do it losslessly -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+------------------------------------ Reporter: feelart | Owner: Type: enhancement | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Changes (by cehoyos): * keywords: audio lossless normalisation => Comment: Please elaborate more on what kind of issue you are reporting: Iiuc, you write above that ''volumedetect is not lossless'' (that is how I read it, note that I am not a native speaker). Since the volumedetect filter does not modify its input, I cannot imagine how it can be more ''lossless'' than it currently is. Otoh, if your issue is that the current filter system does not automatically change audio for some use-case, how would this change be lossless? -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:1> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+------------------------------------ Reporter: feelart | Owner: Type: enhancement | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by feelart): Sorry, I meant volumedetect helps to find out how much you'll change the volume, using vol switch (http://www.ffmpeg.org/ffmpeg-filters.html#volume) To my best knowledge, vol filter does not provide/attempt a lossless normalisation. Lossless normalisation is possible on mp3 & aac, for other codecs I do not know. Instead of having 3 CLI: 1/ first volumedetect 2/ then vol (don't think you can pipe vol with the right normalisation factor from volumedetect directly on the CLI) 3/ run your other instructions It would be nice to have a single CLI such as: {{{ ffmpeg -i src.mp4 -vf "crop=in_w-24*32:in_h-5*32:17*32:3*32,hqdn3d,lut=y=val*0.65" -c:v libx264 -crf 28 -preset slower -a:llnorm -c:a libmp3lame -ac 1 -ar 32000 -aq 0 -async 1 videoStreamProcessedSoundLosslesslyNormalisedThenConvertedToMp3.mp4 }}} You might find strange to make a lossless normalisation, then a sound convertion, but lossless convertion is lossless and convertion might be an user request. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:2> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+------------------------------------ Reporter: feelart | Owner: Type: enhancement | Status: new Priority: normal | Component: avfilter Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------ Comment (by feelart): FYI: MP3Gain provide lossless normalisation on MP3 & aac (with AACGain) Re: http://mp3gain.sourceforge.net/ Lossless can be MD5 verified, as so 1/ Normalising 2/ decrease back by the same amount the normalised sound 3/ compare MD5 of source with processed sound. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:3> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by cehoyos): * priority: normal => wish * component: avfilter => avcodec Comment: Does lame support setting gain? If not, I don't see how this could be implemented in FFmpeg. (If it does support it, I suspect it is already working.) -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:4> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by cehoyos): Could you provide two aac samples made from the same input but with different gain? Ideally, one would be extremely silent to make the difference very obvious. -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:5> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by feelart): {{{ Does lame support setting gain? }}} http://ecmc.rochester.edu/ecmc/docs/lame3.98a2/switchs.html Yes, with the --scale switch, but haven't tested if it's lossless, as I use MP3Gain to batch lossless normalise my MP3 or AAC. {{{ If it does support it, I suspect it is already working }}} Maybe it's due to my lack of deep understanding of ffmpeg, but I failed to make use of LAME switch directly. I do not know how MP3Gain does lossless normalisation of MP3 & AAC, but it's true that for MP3 it requires LAME and for aac it requires AACgain. It's also possible to normalize with SOX http://sox.sourceforge.net/ but have never tried and at this stage don't know if LOSSLESS process. Also, http://gnormalize.sourceforge.net/ (RE-ENCODING !!) http://normalize.nongnu.org/ (re-encoding ????) -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:6> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by cehoyos): Replying to [comment:6 feelart]:
Does lame support setting gain?
Yes, with the --scale switch, but haven't tested if it's lossless
Please test and please clarify if lame just sets metadata or if it actually changes the bitstream. If setting metadata is all you need, a patch may not be difficult, can you provide samples (or point to a specification)? -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:7> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by gjdfgh): * cc: nfxjfg@… (added) -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:8> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by feelart):
If setting metadata is all you need, a patch may not be difficult, can you provide samples (or point to a specification)? I don't think so. Attached is an mp3 example.
ffprobe -i 2normalize.mp3 -show_streams -show_packets and ffprobe -i _isNormalize.mp3 -show_streams -show_packets show no difference (except in name file) -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:9> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by feelart): FYI: https://github.com/elfchief/mp3gain/tree/master/aacgain -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:10> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+----------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: new Priority: wish | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Comment (by cehoyos): Replying to [comment:9 feelart]:
If setting metadata is all you need, a patch may not be difficult, can you provide samples (or point to a specification)? I don't think so.
You mean setting metadata will not be enough, the mp3 files will be encoded differently depending on which value is passed for ''--scale'' ?
Attached is an mp3 example.
ffprobe -i 2normalize.mp3 -show_streams -show_packets and ffprobe -i _isNormalize.mp3 -show_streams -show_packets show no KDiff3 difference (except in file's name)
Meaning the metadata is the only difference between the files while the actual data packets are identical? Sorry, I am not a native speaker... -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:11> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
#2699: automate lossless normalisation -------------------------------------+------------------------------------- Reporter: feelart | Owner: Type: enhancement | Status: open Priority: wish | Component: Version: git-master | undetermined Keywords: | Resolution: Blocking: | Blocked By: Analyzed by developer: 0 | Reproduced by developer: 0 -------------------------------------+------------------------------------- Changes (by richardpl): * status: new => open * component: avcodec => undetermined Comment: There are 2 distinct things: replaygain scanner and applying gain or just storing replaygain value into metadata. mp3 allow apply gain losslessly (by changing single value in bitstream). -- Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2699#comment:12> FFmpeg <http://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg