[FFmpeg-user] Get sample rate in mp3 files

Reindl Harald h.reindl at thelounge.net
Mon Feb 7 17:22:39 EET 2022



Am 07.02.22 um 14:55 schrieb CMG DiGiTaL:
> ok, but the sample rate information is in :
> Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 320 kb/s
> 
> What happens is that I don't know which command I use to compare only the
> sample rate that is in the audio stream and manage to filter
> the audio with only 48000 khz to another folder. That is, what command do I
> use to read only the sample rate 48000 khz and be able to select it??

well, use some scripting labuage like PHP, call ffmpeg and decide by 
if(strpos($ffmpeg_output, ', 48000 Hz,') !== FALSE)

and do yourself a favor and forget the stupid idea "copy them to another 
folder where I will change from
48000 khz to 44100 khz"

one simply don't encode a lossy codec again



More information about the ffmpeg-user mailing list