[FFmpeg-user] Impossile to convert pure audio files to LPCM (S16BE)

pperroux at free.fr pperroux at free.fr
Thu Jan 16 22:29:26 CET 2014


Hello

I've started a tread on FFmpeg Support Forum: http://ffmpeg.gusari.org/viewtopic.php?f=16&t=1231&sid=8a93f24fd6fb95102436a6c0fd955002&p=3271#p3271 
I think now it's better to use this mailing list

I need to convert audio FLAC files to LPCM with FFmpeg but the result is an invalid file
I cannot use another encoder (flac for example) because my DLNA media server (Serviio) has an internal use of FFmpeg 
My player is a DLNA renderer. According to DLNA specification, LPCM "denotes uncompressed audio data, using 16-bit signed representation in two’s-complement notation and network byte order". My understanding of "network byte order" is "Big-Endian" (ie: LPCM_S16BE)

$ ffmpeg -i InputFile.flac -y -threads 4 -ar 44100 -ac 2 -f s16be OutputFile.flv
    ffmpeg version git-2014-01-14-b821def Copyright (c) 2000-2014 the FFmpeg developers
      built on Jan 14 2014 20:15:19 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
      configuration: --disable-opencl --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp --enable-libxvid --enable-libass --enable-libvpx
      libavutil      52. 62.100 / 52. 62.100
      libavcodec     55. 48.101 / 55. 48.101
      libavformat    55. 23.103 / 55. 23.103
      libavdevice    55.  5.102 / 55.  5.102
      libavfilter     4.  1.100 /  4.  1.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, flac, from 'InputFile.flac':
      Duration: 00:01:00.00, bitrate: 829 kb/s
        Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Output #0, s16le, to 'OutputFile.flv':
      Metadata:
        encoder         : Lavf55.23.103
        Stream #0:0: Audio: pcm_s16be, 44100 Hz, stereo, s16, 1411 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (flac -> pcm_s16be)
    Press [q] to stop, [?] for help
    size=   10336kB time=00:01:00.00 bitrate=1411.2kbits/s
    video:0kB audio:10336kB subtitle:0 global headers:0kB muxing overhead 0.000000%
$ ffmpeg -i OutputFile.flv
    ffmpeg version git-2014-01-14-b821def Copyright (c) 2000-2014 the FFmpeg developers
      built on Jan 14 2014 20:15:19 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
      configuration: --disable-opencl --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp --enable-libxvid --enable-libass --enable-libvpx
      libavutil      52. 62.100 / 52. 62.100
      libavcodec     55. 48.101 / 55. 48.101
      libavformat    55. 23.103 / 55. 23.103
      libavdevice    55.  5.102 / 55.  5.102
      libavfilter     4.  1.100 /  4.  1.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    OutputFile.flv: Invalid data found when processing input

With the help of FFmpeg forum I also tried to change the FFmpeg command
But when asking to transcode to Big-Endian (pcm_16be) the conversion in a FLV container with "-acodec pcm_s16be" create a file which is:
- Seen as LPCM_S16LE by FFmpeg (Little Endian !!!)
- Impossible to read with software players (tested with VLC and Foobar2000)

$ fmpeg -i InputFile.flac -y -acodec pcm_s16be OutputFile.flv
    ffmpeg version git-2014-01-14-b821def Copyright (c) 2000-2014 the FFmpeg developers
      built on Jan 14 2014 20:15:19 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
      configuration: --disable-opencl --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp --enable-libxvid --enable-libass --enable-libvpx
      libavutil      52. 62.100 / 52. 62.100
      libavcodec     55. 48.101 / 55. 48.101
      libavformat    55. 23.103 / 55. 23.103
      libavdevice    55.  5.102 / 55.  5.102
      libavfilter     4.  1.100 /  4.  1.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, flac, from 'InputFile.flac':
      Duration: 00:01:00.00, bitrate: 826 kb/s
        Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Output #0, flv, to 'OutputFile.flv':
      Metadata:
        encoder         : Lavf55.23.103
        Stream #0:0: Audio: pcm_s16be, 44100 Hz, stereo, s16, 1411 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (flac -> pcm_s16be)
    Press [q] to stop, [?] for help
    size=   10346kB time=00:01:00.00 bitrate=1412.6kbits/s   
    video:0kB audio:10336kB subtitle:0 global headers:0kB muxing overhead 0.099745%
$ ffmpeg -i OutputFile.flv
    ffmpeg version git-2014-01-14-b821def Copyright (c) 2000-2014 the FFmpeg developers
      built on Jan 14 2014 20:15:19 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
      configuration: --disable-opencl --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp --enable-libxvid --enable-libass --enable-libvpx
      libavutil      52. 62.100 / 52. 62.100
      libavcodec     55. 48.101 / 55. 48.101
      libavformat    55. 23.103 / 55. 23.103
      libavdevice    55.  5.102 / 55.  5.102
      libavfilter     4.  1.100 /  4.  1.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, flv, from 'OutputFile.flv':
      Metadata:
        encoder         : Lavf55.23.103
      Duration: 00:01:00.00, start: 0.000000, bitrate: 1412 kb/s
        Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
    At least one output file must be specified

Regards
Pierre


More information about the ffmpeg-user mailing list