Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#4695 closed defect (invalid)

Why is that PCM invalid?

Reported by: Michael Heuberger Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: michael.heuberger@binarykitchen.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Trying to play an audio PCM file from the command line but fail:

$ avplay 1.pcm
                                                                          
avplay version 11-6:11-1, Copyright (c) 2003-2014 the Libav developers
  built on Sep 26 2014 14:36:31 with gcc 4.9.1 (Ubuntu 4.9.1-15ubuntu1)
1.pcm: Invalid data found when processing input

What's wrong? How can I investigate this? Corrupt PCM or an avplay bug?

Attachments (1)

1.pcm (4.0 KB ) - added by Michael Heuberger 9 years ago.
The one PCM file I am trying to play …

Download all attachments as: .zip

Change History (9)

by Michael Heuberger, 9 years ago

Attachment: 1.pcm added

The one PCM file I am trying to play ...

comment:1 by Michael Heuberger, 9 years ago

Cc: michael.heuberger@binarykitchen.com added

Attached is the PCM file ... it's recorded from a webcam.

comment:2 by Michael Heuberger, 9 years ago

Sorry, wrong command, also happens with ffplay:

$ ffplay 1.pcm
                                                                         
ffplay version 2.4.2 Copyright (c) 2003-2014 the FFmpeg developers
  built on Oct 10 2014 15:15:58 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
1.pcm: Invalid data found when processing inputKB sq=    0B f=0/0 


comment:3 by Hendrik, 9 years ago

if its truely a pcm file, then it does not have a header describing its format - you will need to specify this. Channel, Sample Rate, Bitdepth, etc.

comment:4 by Michael Heuberger, 9 years ago

if so, how can I find out best, how many channels it has, the sample rate and bit depth? is there a script to find this out?

does ffplay come with arguments to define these three parameters?

comment:5 by Michael Heuberger, 9 years ago

i tried following but i do hear nothing

$ ffplay -channels 1 -f s16le 1.pcm                                                                staging 
ffplay version 2.4.2 Copyright (c) 2003-2014 the FFmpeg developers
  built on Oct 10 2014 15:15:58 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[s16le @ 0x7f6bcc0008c0] Estimating duration from bitrate, this may be inaccurate
Input #0, s16le, from '1.pcm':
  Duration: 00:00:00.05, bitrate: 705 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
  14.98 M-A:  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0   

comment:6 by Michael Heuberger, 9 years ago

some context: these pcm's come from the web, were initially raw webAudio samples in Float32Array's which have been converted to 16 bit signed integers with this JS function:

    this.toBuffer = function() {

        var l   = float32Array.length,
            arr = new Int16Array(l)

        // this uses lots of CPU and should be optimized
        for (var i = 0; i < l; i++) {
            arr[i] = Math.min(1, float32Array[i]) * 0x7FFF
        }

        return toBuffer(arr)
    }

comment:7 by Carl Eugen Hoyos, 9 years ago

Resolution: invalid
Status: newclosed

There is no indication for a bug, please post all usage questions on the user mailing list.

Note: See TracTickets for help on using tickets.