[FFmpeg-user] How to create error log file ffmpeg Loudnorm?
CMG DiGiTaL
cmarciog at gmail.com
Fri Apr 26 13:44:34 EEST 2024
>
> You said:
> *-report file=test.log:level=16* the character * on the commandline
> causes ffmpeg to look at this as a outputfile specification to put
> decoded results in, as nothing is specified about how to decode it it
> tries to guess what codecs to use on the extension. Naturally this does
> not work. Easiest way to get your desired result is to set the logfile
> creation as an environment variable in the beginning of your script your
> script and remove it from the ffmpeg commandline like this:
>
> FFREPORT=file=test.log:level=16 md
> "C:\Users\%username%\Desktop\Normalizando_lufs"
> ffmpeg -hide_banner -i "!filename!.mp3"
>
>
>
> Information 1:
> 1.1 - When I use the command FFREPORT:
> FFREPORT=file=test.log:level=16 md
> "C:\Users\%username%\Desktop\Normalizando_lufs" ffmpeg -hide_banner -i
> "!filename!.mp3"
>
> Show the error:
> 'FFREPORT' is not recognized as an internal command
> or external, an operable program or a batch file.
>
> PS 1: in this case, so that the FFREPORT command does not show the
> above error, I have to put SET before it, eg:
> SET FFREPORT=file=test.log:level=16 md
> "C:\Users\%username%\Desktop\Normalizando_lufs" ffmpeg -hide_banner -i
> "!filename!.mp3"
>
> then it shows the error:
> [NULL @ 00000268a5249100] Unable to find a suitable output format
> for 'FFREPORT=file=test.log:level=16'
> FFREPORT=file=test.log:level=16: Invalid argument
>
> 1.2 - Note, in my code, that the loudnorm command is inside a FOR loop.
>
>
> My question: In which part of the code should I place the FFREPORT command?
>
>
> I'll explain the code better:
>
> md "C:\Users\%username%\Desktop\Normalizando_lufs" ------------> temporary
> folder for audio files being normalized
> pushd "%Userprofile%\Desktop\µudios LUFS" ------------>
> original folder containing the audio files
>
>
>
> __
> FOR /F "delims=" %%a in ('where .:*.mp3 ^|findstr /vi "_LOUDNORM _EBU"')
> DO ( |
> SET "filename=%%~na"
>
> |
> ffmpeg -hide_banner -i "%%a" -af "[0:a]loudnorm=print_format=summary" -f
> null NUL 2> "%%~na.log" |
> @FOR /F "tokens=3" %%b IN ('FINDSTR /C:"Input Integrated" "%%~na.log"')
> DO (SET II=%%b) | getting information from audio file
> @FOR /F "tokens=4" %%b IN ('FINDSTR /C:"Input True Peak" "%%~na.log"')
> DO (SET ITP=%%b) | to use in the loudnorm command
> @FOR /F "tokens=3" %%b IN ('FINDSTR /C:"Input LRA" "%%~na.log"') DO (SET
> ILRA=%%b) |
> @FOR /F "tokens=3" %%b IN ('FINDSTR /C:"Input Threshold" "%%~na.log"')
> DO (SET IT=%%b) |
> @FOR /F "tokens=3" %%b IN ('FINDSTR /C:"Target Offset" "%%~na.log"') DO
> (SET TO=%%b) __|
> DEL "%%~na.log"
>
>
> SETLOCAL ENABLEDELAYEDEXPANSION
> FOR /F "tokens=1,2 delims=," %%b IN ('ffprobe -v 0 -select_streams a
> -show_entries "stream=bit_rate,sample_rate" -of "csv=p=0"
> "!filename!.mp3"') -----> getting information about the sample rate and
> bitrate of the audio file
>
>
> to use in the loudnorm command
>
> DO (
> ffmpeg -hide_banner -i "!filename!.mp3" -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 -metadata:s:v title="Album cover" -metadata:s:v
> comment="Cover (front)" -acodec mp3 -b:a %%c -ar:a %%b
> "C:\Users\%username%\Desktop\Normalizando_lufs\!filename!.mp3"
> )
>
> ENDLOCAL
> )
>
> xcopy "C:\Users\%username%\Desktop\Normalizando_lufs\*.mp3"
> "C:\Users\%username%\Desktop\µudios LUFS Normalizados\LOUDNORM\MP3\LUFS
> %_vLUF%" /y /s /i -------> copies the normalized audio files to the
> Final folder
>
>
> __
> del /q "C:\Users\%username%\Desktop\Normalizando_lufs\*.*" |
> Remove temporary folder from desktop
> rmdir "C:\Users\%username%\Desktop\Normalizando_lufs" /s /q __|
>
>
More information about the ffmpeg-user
mailing list