[FFmpeg-user] Fwd: Get sample rate in mp3 files
CMG DiGiTaL
cmarciog at gmail.com
Mon Feb 21 09:52:44 EET 2022
hi Reino,
I did these commands below, taking advantage of what you sent me to test
the LUFS changes of the audio files. I have some doubts:
- Can I use a command of this size directly in cmd?
- I can put multiple @for in this command. Note that I do several findstr
in the txt file I generated with the first ffmpeg to enter as
parameters in the second ffmpeg.
FOR *%G* IN (*.mp3) DO (
set vluf=-10.0
set vpeak=-0.0
@for /f "delims=" *%A* IN ('ffprobe -v 0 -show_entries *stream^=bit_rate*
-of csv^=p^=0 "*%G*"')
*ffmpeg* -i "%G" -filter_complex
"[0:a]loudnorm=I=-15:TP=-1.5:LRA=11:print_format=summary" -f null x 2>%1.txt
@for /f "tokens=3" %B in ('findstr /C:"Input Integrated" %1.txt') do (set
II=%B)
echo "%II" is the Input Integrated
@for /f "tokens=4" %B in ('findstr /C:"Input True Peak" %1.txt') do (set
*ITP*=%B)
echo "%ITP" is the Input True Peak
@for /f "tokens=3" %B in ('findstr /C:"Input LRA" %1.txt') do (set *ILRA*
=%B)
echo %ILRA is the Input LRA
@for /f "tokens=3" %B in ('findstr /C:"Input Threshold" %1.txt') do (set*
IT*=%B)
echo %IT is the Input Threshold
@for /f "tokens=3" %B in ('findstr /C:"Output Integrated" %1.txt') do
(set *OI*=%B)
echo %OI is the Output Integrated
@for /f "tokens=4" %B in ('findstr /C:"Output True Peak" %1.txt') do (set
*OTP*=%B)
echo %OTP is the Output True Peak
@for /f "tokens=3" %B in ('findstr /C:"Output LRA" %1.txt') do (set *OLRA*
=%B)
echo %OLRA is the Output LRA
@for /f "tokens=3" %B in ('findstr /C:"Output Threshold" %1.txt') do (set
*OT*=%B)
echo %OT is the Output Threshold
@for /f "tokens=3" %B in ('findstr /C:"Target Offset" %1.txt') do (set
*TO*=%B)
echo %TO is the Target Offset
*ffmpeg* -i "%G" -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:a libmp3lame -b:a *%A* "..\Áudios LUFS ORI\%~nA_LUFS_CONVERTED.mp3"
)
ps.I edited the txt file generated in ffmpeg and it shows the following
message:
ffmpeg version 2021-10-18-git-d04c005021-full_build-www.gyan.dev Copyright
(c) 2000-2021 the FFmpeg developers
built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable -gmp --enable-lzma
--enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable -libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi
--enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable -libaom --enable-libopenjpeg
--enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype
--enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg
--enable -amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec
--enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2
--enable-libmfx --enable-libglslang - -enable-vulkan --enable-opencl
--enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex - -enable-libvorbis --enable-ladspa
--enable-libs2b --enable-libflite --enable-libmysofa --enable-librubberband
--enable-libsoxr --enable-chromaprint
libavutil 57. 7,100 / 57. 7,100
libavcodec 59. 12.100 / 59. 12.100
libavformat 59. 6,100 / 59. 6,100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 14.100 / 8. 14.100
libswscale 6.1100 / 6.1100
libswresample 4.0.100 / 4.0.100
libpostproc 56.0.100 / 56.0.100
*%G: No such file or directory*
See that it reports not finding the file or directory of the *first FOR*!
What is wrong with my command, I looked at it several times and I can't see
the error?!
thanks
Clamarc
---------- Forwarded message ---------
De: CMG DiGiTaL <cmarciog at gmail.com>
Date: dom., 20 de fev. de 2022 às 23:35
Subject: Re: [FFmpeg-user] Get sample rate in mp3 files
To: FFmpeg user questions <ffmpeg-user at ffmpeg.org>
More information about the ffmpeg-user
mailing list