[FFmpeg-user] Audio automatically resampled to 8bit from 24bit when using concat and lavfi nullsrc
Paul B Mahol
onemda at gmail.com
Sat Apr 9 21:52:32 EEST 2022
On Sat, Apr 9, 2022 at 8:31 PM morgan holly via ffmpeg-user <
ffmpeg-user at ffmpeg.org> wrote:
> >> > On Sat, Apr 9, 2022 at 5:22 PM morgan holly via ffmpeg-user <
> ffmpeg-user at ffmpeg.org <mailto:ffmpeg-user at ffmpeg.org>> wrote:
> >> > this is part question and part warning. When I run the cmd below
> FFMPEG automatically knocks my 24bit source audio down to 8bits(!). I was
> able to change that by adding 'aformat=sample_fmts=s32' into the
> filterchain for the anullsrc inputs.
> >> >
> >> > The warning is: make sure you check your output quality if you use
> lavfi slugs with your audio. 24->8bits, yikes.
> >> >
> >> > The question is: Can I specify the format of the nullsource when
> using lavfi. Seems dangerous that it defaults to fmt:u8. Am I doing
> something wrong?
> >> >
> >> > You are not setting aformat right after anullsrc filter.
> >> >
> >> Thanks for the response. I googled it out and ended up with this:
> >> ffmpeg -y -f lavfi -t 1.724 -i
> anullsrc=channel_layout=mono:sample_rate=48000,aformat=s32 -ss 120 -t
> 30.327979 -i /tmp/2ch.mov -f lavfi -t 1.724 -i
> anullsrc=channel_layout=mono:sample_rate=48000,aformat=s32 -filter_complex
> "[0:a:0][1:a:0][2:a:0]concat=n=3:v=0:a=1[sf1_out]" -map [sf1_out]
> >> It works, but it does seem odd that the default bit depth of nullsrc
> would be 8.
> > That is because your source is not connected with rest of filters, so
> guessing best format never can happen.
> I don’t understand, but would like to. I have three sources here: mov and
> 2 lavfi, everything is connected in concat.
-f lavfi is disconnected from rest of -filter_complex filters.
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-user