Does adding silence to a flac with an ffmpeg filter result in any quality loss?
2
votes
1
answer
115
views
I'm attempting to add a few seconds of silence to the end of several flac audio files. One recommended method is:
# ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -t 5 silence.flac
# ffmpeg -i 'concat:input.flac|silence.flac' -c:a copy output.flac
When I do this, however, the output.flac appears to have the same length as input.flac (as reported, e.g., by ffprobe
, mediainfo
, or when played in vlc). I'm not sure why it's not working, but the following also does what I want by extending the file by five seconds as silence:
# ffmpeg -i input.flac -af apad=pad_dur=5s output.flac
I've read that the latter approach has the disadvantage of re-encoding the file. But if the input and output are both flac, does that mean the re-encoding is done with no quality loss?
Separately, any suggestions on why the first method is not generating a longer audio file with five seconds of silence at the end?
Asked by Adam J. Kessel
(81 rep)
Mar 24, 2025, 06:09 PM
Last activity: Mar 24, 2025, 06:26 PM
Last activity: Mar 24, 2025, 06:26 PM