[FFmpeg-user] mp3 audio output recording error message when he has Cover

Reino Wijnsma rwijnsma at xs4all.nl
Sun Mar 13 16:36:02 EET 2022

Hello Clamarc,

On 2022-03-07T03:53:10+0100, CMG DiGiTaL <cmarciog at gmail.com> wrote:
> [...]
> ffmpeg -hide_banner -i "%file% -filter_complex "[0:a]loudnorm=print_format=summary" -f null NUL 2>1.txt

You forgot a closing double-quote after %file%. And btw, -af instead of -filter_complex would do as well.

> [...]
> FOR /F "tokens=1,2 delims=," %%b IN ('ffprobe -v 0 -show_entries stream^=bit_rate^,sample_rate -of csv^=p^=0 "%file%"') DO ( ffmpeg -vsync vfr -hide_banner -i "%file%" -af loudnorm=linear=true:I=%vLUF%:LRA=11:tp=%vPEAK%:measured_I=%II%:measured_LRA=%ILRA%:measured_tp=%ITP%:measured_thresh=%IT%:offset=%TO%:print_format=summary -c:v copy -id3v2_version 3 -c:a libmp3lame -b:a %%c -ar:a %%b "C:\Users\%username%\Desktop\Converting_lufs\%file%")

Now I understand why you posted 2 logs. FFprobe is trying to print the bit_rate and sample_rate of *both* streams (the audiostream as well as the coverart). So it would print for instance...


...and then FFmpeg is called twice. First with 44100 and 192000, and a second time only with "N/A". You'd have to restrict ffprobe to only process the audiostream:

ffprobe -v 0 *-select_streams a* -show_entries [...]

Btw, there's no need for escape-characters if you use double-quotes:

ffprobe -v 0 -select_streams a -show_entries "stream=bit_rate,sample_rate" -of "csv=p=0" "%file%"

And please do the same for the ffmpeg command. I'm actually surprised it worked without:

-af "loudnorm=linear=true:I=%vLUF%:LRA=11:tp=%vPEAK%:measured_I=%II%:measured_LRA=%ILRA%:measured_tp=%ITP%:measured_thresh=%IT%:offset=%TO%:print_format=summary"

And do you really need -vsync vfr ? I'm no expert, but I think it's totally useless in this situation.


More information about the ffmpeg-user mailing list