[FFmpeg-user] ffmpeg - Creating output file
CMG DiGiTaL
cmarciog at gmail.com
Fri Apr 8 01:48:23 EEST 2022
Em qui., 7 de abr. de 2022 às 10:55, CMG DiGiTaL <cmarciog at gmail.com>
escreveu:
> I use the command below to generate the LUFS normalization file. Note that
> the output file will be generated in the same folder as the renamed input
> file.
> Command:
>
> FOR /F "tokens=1,2 delims=," %%b IN ('ffprobe -v 0 -select_streams a
> -show_entries "stream=sample_fmt,sample_rate" -of "csv=p=0"
> "!filename!.flac"') DO (
> ffmpeg -hide_banner -y -i "!filename!.flac" -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)" -map 0:0 -c:a flac -sample_fmt:a %%b -ar:a %%c
> "..\Áudios LUFS\!filename!_LUFS_!vLUF!.flac"
>
> Note that the output file name will be:
> "..\LUFS Audios\!filename!_LUFS_!vLUF!.flac"
> eg. Music_LUFS_-10.0.flac
>
> When I run the command in the folder that already has this file, a new
> file is created:
> Music_LUFS_-10.0_LUFS_-10.0
>
> So the folder has two files with the same content but with different names:
> Music_LUFS_-10.0.flac
> Music_LUFS_-10.0_LUFS_-10.0.flac
>
> The output command:
> "..\LUFS Audios\!filename!_LUFS_!vLUF!.flac"
>
> can it be used with some option to replace files that have the same names
> instead of creating another one with a different name?
>
>
>
I managed to solve this problem, it was enough to change the FOR command
so that the files that have the string "_LUFS_" are not read as input
files. See the change below:
for /f "delims=" %%a in ('dir /b *.flac ^|find /v /i "_LUFS_"') do
(commands...
More information about the ffmpeg-user
mailing list