[FFmpeg-user] need help to convert wav to mp3

Ashtiani ashtiani.alireza at gmail.com
Wed Sep 22 13:42:14 EEST 2021


thanks for reply
I try  these codecs in my linux the result is :


*"ffmpeg -acodec pcm_s16le -i input.wav out.mp3" : *
[pcm_s16le @ 0x1103940] Multiple frames in a packet.  0x
[pcm_s16le @ 0x1103940] Invalid PCM packet, data has size 2 but at least a
size of 4 was expected
Error while decoding stream #0:0: Invalid data found when processing input



*"ffmpeg -acodec pcm_s24le -i input.wav out.mp3" : *
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --arch=x86_64 --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --disable-debug --disable-static
--disable-stripping --enable-avcodec --enable-avdevice --enable-avfilter
--enable-avformat --enable-avresample --enable-alsa --enable-bzlib
--enable-chromaprint --enable-decklink --enable-frei0r --enable-gcrypt
--enable-gmp --enable-gpl --enable-gray --enable-iconv --enable-ladspa
--enable-libass --enable-libaom --enable-libbluray --enable-libbs2b
--enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdc1394
--enable-libdav1d --enable-libdavs2 --enable-libdrm --enable-libfdk-aac
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libiec61883 --enable-libilbc
--enable-libjack --enable-libkvazaar --enable-libmodplug
--enable-libmp3lame --enable-libndi_newtek --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq
--enable-librsvg --enable-librtmp --enable-librubberband
--enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtesseract --enable-libtheora
--enable-libtwolame --enable-libv4l2 --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxcb
--enable-libxcb-shape --enable-libxcb-shm --enable-libxcb-xfixes
--enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzvbi
--enable-lzma --enable-nonfree --enable-openal --enable-opencl
--enable-opengl --enable-openssl --enable-postproc --enable-sdl2
--enable-shared --enable-swresample --enable-swscale --enable-vaapi
--enable-version3 --enable-vdpau --enable-xlib --enable-zlib
--incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man
--optflags='-O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
--prefix=/usr --shlibdir=/usr/lib64 --enable-libsrt --enable-libzmq
--enable-v4l2-m2m --enable-vapoursynth --enable-vulkan --enable-cuda
--enable-cuvid --enable-ffnvcodec --enable-libmfx --enable-libnpp
--enable-libsvtav1 --enable-libsvthevc --enable-libsvtvp9 --enable-libvmaf
--enable-nvdec --enable-nvenc --extra-cflags=-I/usr/include/cuda
--cpu=x86_64
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'input.wav':
  Duration: 00:01:50.54, bitrate: 26 kb/s
  Stream #0:0: Audio: pcm_s24le ([1][7][0][0] / 0x0701), 8000 Hz, stereo,
s32 (24 bit), 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'out.mp3':
  Metadata:
    TSSE            : Lavf58.76.100
  Stream #0:0: Audio: mp3, 8000 Hz, stereo, s32p (24 bit)
    Metadata:
      encoder         : Lavc58.134.100 libmp3lame
size=      23kB time=00:00:07.56 bitrate=  24.9kbits/s speed= 107x
video:0kB audio:23kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 1.118827%


*" ffmpeg -acodec pcm_s32le -i 1904339297.wav out.mp3" : *
ress [q] to stop, [?] for help
[pcm_s32le @ 0xf90c40] Multiple frames in a packet.
[pcm_s32le @ 0xf90c40] Invalid PCM packet, data has size 4 but at least a
size of 8 was expected
Error while decoding stream #0:0: Invalid data found when processing input
Output #0, mp3, to 'out.mp3':
  Metadata:
    TSSE            : Lavf58.76.100
  Stream #0:0: Audio: mp3, 8000 Hz, stereo, s32p
    Metadata:
      encoder         : Lavc58.134.100 libmp3lame
[pcm_s32le @ 0xf90c40] Invalid PCM packet, data has size 4 but at least a
size of 8 was expected
Error while decoding stream #0:0: Invalid data found when processing input
[pcm_s32le @ 0xf90c40] Invalid PCM packet, data has size 4 but at least a
size of 8 was expected
Error while decoding stream #0:0: Invalid data found when processing input
[pcm_s32le @ 0xf90c40] Invalid PCM packet, data has size 4 but at least a
size of 8 was expected
Error while decoding stream #0:0: Invalid data found when processing input



thanks a lot ;


On Wed, Sep 22, 2021 at 12:36 PM Arif Driessen <arifd86 at gmail.com> wrote:

> Looking at your output it looks like it can't figure out what your
> input.wav is. Does your wav file work in other applications? Have you tried
> increasing the value for 'analyzeduration'?
> If you know the details you could manually specify them, something like:
> ffmpeg -acodec pcm_s16le -i input.wav out.mp3 (it's likely going to be
> pcm_s16le or pcm_s24le or pcm_s32le)
>
> Perhaps you don't have these codec installed/enabled. You will want
> something with PCM in it. Run: ffmpeg -codecs and look for anything with
> PCM in it. On Linux, and possibly Mac, you could run: ffmpeg -codecs | grep
> -e '\sPCM'
> to filter for lines containing PCM for you.
>
> On Wed, Sep 22, 2021 at 7:41 AM Ashtiani <ashtiani.alireza at gmail.com>
> wrote:
>
> > Try to Convert an Audio wave format file to mp3 with ffmpeg with below
> > command :
> >
> > ffmpeg  -i input.wav output.mp3
> >
> > but ffmpeg say 'could not find codec':
> >
> > ffmpeg version 2021-09-16-git-8f92a1862a-full_build-www.gyan.dev
> > Copyright (c) 2000-2021 the FFmpeg developers
> >   built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
> >   configuration: --enable-gpl --enable-version3 --enable-static
> > --disable-w32threads --disable-autodetect --enable-fontconfig
> > --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp
> > --enable-lzma --enable-libsnappy --enable-zlib --enable-librist
> > --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth
> > --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d
> > --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp
> > --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom
> > --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r
> > --enable-libfreetype --enable-libfribidi --enable-libvidstab
> > --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
> > --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc
> > --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang
> > --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme
> > --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb
> > --enable-libmp3lame --enable-libshine --enable-libtheora
> > --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc
> > --enable-libgsm --enable-libopencore-amrnb --enable-libopus
> > --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b
> > --enable-libflite --enable-libmysofa --enable-librubberband
> > --enable-libsoxr --enable-chromaprint
> >   libavutil      57.  5.100 / 57.  5.100
> >   libavcodec     59.  7.103 / 59.  7.103
> >   libavformat    59.  5.100 / 59.  5.100
> >   libavdevice    59.  0.101 / 59.  0.101
> >   libavfilter     8.  9.100 /  8.  9.100
> >   libswscale      6.  1.100 /  6.  1.100
> >   libswresample   4.  0.100 /  4.  0.100
> >   libpostproc    56.  0.100 / 56.  0.100
> > [wav @ 000001a24340ea40] Could not find codec parameters for stream 0
> > (Audio: none ([1][7][0][0] / 0x0701), 8000 Hz, 2 channels, 26 kb/s):
> > unknown codec
> > Consider increasing the value for the 'analyzeduration' (0) and
> > 'probesize' (5000000) options
> > Guessed Channel Layout for Input Stream #0.0 : stereo
> > Input #0, wav, from 'input.wav':
> >   Duration: 00:01:50.54, bitrate: 26 kb/s
> >   Stream #0:0: Audio: none ([1][7][0][0] / 0x0701), 8000 Hz, stereo, 26
> > kb/s
> > Stream mapping:
> >   Stream #0:0 -> #0:0 (? (?) -> mp3 (libmp3lame))
> > Decoder (codec none) not found for input stream #0:0
> >
> > tnx
> >
> > aras
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> >
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list