[FFmpeg-user] How to analyse a pure audio file by ffmpeg commands?

JIA Pei jp4work at gmail.com
Tue Feb 19 14:51:58 CET 2013


Thank you so much Carl...
My test.ogg is produced/recorded by Audacity

And, I tried your method, but it seems *"how many samples"* are in this
audio file is not produced:



~/Desktop$ ffmpeg -i test.ogg -f null -
ffmpeg version N-49571-gb5f544a Copyright (c) 2000-2013 the FFmpeg
developers
  built on Feb  3 2013 21:52:30 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
  configuration: --prefix=/usr --enable-gpl --enable-version3
--enable-shared --enable-gnutls --enable-libass --enable-libbluray
--enable-libcaca --enable-libdc1394 --enable-libflite --enable-libfreetype
--enable-libgsm --enable-libiec61883 --enable-libmodplug
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libspeex --enable-libtheora
--enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
--enable-openal
  WARNING: library configuration mismatch
  swscale     configuration: --arch=i386 --enable-pthreads
--enable-runtime-cpudetect --extra-version='6:0.8.5-0ubuntu0.12.10.1'
--libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib
--enable-libdc1394 --enable-libfreetype --enable-gnutls --enable-libgsm
--enable-libpulse --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis
--enable-libvpx --enable-zlib --enable-gpl --enable-postproc
--enable-swscale --enable-libcdio --enable-x11grab
--shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared
--disable-static
  postproc    configuration: --arch=i386 --enable-pthreads
--enable-runtime-cpudetect --extra-version='6:0.8.5-0ubuntu0.12.10.1'
--libdir=/usr/lib/i386-linux-gnu --prefix=/usr --enable-bzlib
--enable-libdc1394 --enable-libfreetype --enable-gnutls --enable-libgsm
--enable-libpulse --enable-libschroedinger --enable-libspeex
--enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis
--enable-libvpx --enable-zlib --enable-gpl --enable-postproc
--enable-swscale --enable-libcdio --enable-x11grab
--shlibdir=/usr/lib/i386-linux-gnu/i686/cmov --cpu=i686 --enable-shared
--disable-static
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  1.  0
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  0.  0
Input #0, ogg, from 'test.ogg':
  Duration: 00:00:0*6.15*, start: 0.000000, bitrate: 85 kb/s
    Stream #0:0: Audio: vorbis, 44100 Hz, mono, fltp, 96 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf54.61.104
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, *mono*, s16, 705 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (vorbis -> pcm_s16le)
Press [q] to stop, [?] for help
size=N/A time=00:00:0*6.16* bitrate=N/A
video:0kB audio:531kB subtitle:0 global headers:0kB muxing overhead
-100.004045%



I can tell this audio file is mono, namely, 1 channel. But, how many
samples in total? Or, I've got to estimate by myself ??? Say:
(85kb/s*6.15s) = 522750 bits.
That is 65343.75 bytes, 32671.875 short integers, namely, 32671.875 samples?


Cheers
Pei








On Tue, Feb 19, 2013 at 5:39 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> JIA Pei <jp4work <at> gmail.com> writes:
>
> > Is there a ffmpeg command to analyse an audio file?
> >
> > 1) How many samples are in this audio file?
>
> I may misunderstand, but the following often helps:
> $ ffmpeg -i file -f null -
>
> > 2) How many audio channels are in this audio file? 1 or 2?
>
> $ ffmpeg -i file
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



-- 

Pei JIA

Email: jp4work at gmail.com
cell:    +1 604-362-5816

Welcome to Vision Open
http://www.visionopen.com


More information about the ffmpeg-user mailing list