Opened 12 years ago

Closed 5 years ago

Last modified 5 years ago

#2304 closed enhancement (invalid)

Support PCM_S16BE in WAVE

Reported by: Dennis Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
It appears FFmpeg does not support PCM signed 16-bit big endian in WAVE. I believe this should be supported by the RIFX file format.

How to reproduce:

"Copy" Audio Codec from source

ffmpeg -i Bad.mpg -acodec copy Bad.wav
ffmpeg version N-50311-gbfcc38e Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 25 2013 18:40:51 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.103 / 52. 17.103
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 41.100 /  3. 41.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpeg @ 00000000025ba4c0] Format mpeg detected only with low score of 25, misdet
ection possible!
[mpeg @ 00000000025ba4c0] max_analyze_duration 5000000 reached at 5008211 micros
econds
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mpeg, from 'Bad.mpg':
  Duration: 00:04:21.25, start: 0.017378, bitrate: 7386 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 8:9 DAR
4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0xa0]: Audio: pcm_s16be, 48000 Hz, stereo, s16, 1536 kb/s
[wav @ 0000000005170020] NONE codec not supported in WAVE format
Output #0, wav, to 'Bad.wav':
  Metadata:
    encoder         : Lavf54.63.100
    Stream #0:0: Audio: pcm_s16be, 48000 Hz, stereo, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Operat
ion not permitted

Force PCM_S16BE

ffmpeg -i Bad.mpg -acodec pcm_s16be Bad.wav
ffmpeg version N-50311-gbfcc38e Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb 25 2013 18:40:51 with gcc 4.7.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
sm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libo
pencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-lib
twolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enabl
e-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 17.103 / 52. 17.103
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.100 / 54. 63.100
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 41.100 /  3. 41.100
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
[mpeg @ 000000000247a4c0] Format mpeg detected only with low score of 25, misdet
ection possible!
[mpeg @ 000000000247a4c0] max_analyze_duration 5000000 reached at 5008211 micros
econds
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mpeg, from 'Bad.mpg':
  Duration: 00:04:21.25, start: 0.017378, bitrate: 7386 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [SAR 8:9 DAR
4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0xa0]: Audio: pcm_s16be, 48000 Hz, stereo, s16, 1536 kb/s
[wav @ 0000000005010020] pcm_s16be codec not supported in WAVE format
Output #0, wav, to 'Bad.wav':
  Metadata:
    encoder         : Lavf54.63.100
    Stream #0:0: Audio: pcm_s16be, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_s16be -> pcm_s16be)
Could not write header for output file #0 (incorrect codec parameters ?): Operat
ion not permitted

Change History (14)

comment:1 by Carl Eugen Hoyos, 12 years ago

Resolution: duplicate
Status: newclosed

Out of curiosity: On which work-flow would this feature help?

I am closing this as a duplicate of ticket #1978.

comment:2 by Dennis, 12 years ago

Okay, thanks.

These are Michael Jackson music videos that came on a bonus disc.
As a work around I just convert the audio to little endian.

in reply to:  2 comment:3 by Carl Eugen Hoyos, 12 years ago

Replying to DJX:

These are Michael Jackson music videos that came on a bonus disc.

What I meant is: If above command line (with -acodec copy or -acodec pcm_s16be) would work, what would you do with the resulting rifx/wavx file?

Version 0, edited 12 years ago by Carl Eugen Hoyos (next)

comment:4 by Dennis, 12 years ago

I was just going to play with them, nothing important.
First thing that comes to mind is: I was going to put them in a DAW and analyze to check if the audio truly is uncompressed as is (or if it was compressed before being sampled into its current format).

...prob nothing I couldn't do by converting it to little endian but I wanted to keep the audio stream untouched.

in reply to:  4 comment:5 by Carl Eugen Hoyos, 12 years ago

Replying to DJX:

I was just going to play with them, nothing important.
First thing that comes to mind is: I was going to put them in a DAW and analyze to check if the audio truly is uncompressed as is (or if it was compressed before being sampled into its current format).

(Disclaimer: I don't know what a DAW is.)
I wanted to know why (or if) you expect that the software (or hardware) you want to use with the rifx wave files would be able to read such a very unusual format?

comment:6 by Dennis, 12 years ago

Oh, no problem.
I was going to mess with it in a digital audio workstation (DAW)/editor.

Hmm, guess I didn't think it was that unusual.
...now you got me wondering if, indeed, it would have worked...who knows.

in reply to:  6 comment:7 by Carl Eugen Hoyos, 12 years ago

Replying to DJX:

...now you got me wondering if, indeed, it would have worked...who knows.

You can test with the file attached to ticket #1978.

comment:8 by Dennis, 12 years ago

Ah, thanks man.
...and you're right, it does not work.

The only program I could get to play the file was Winamp.

Thanks.

comment:9 by Dennis, 8 years ago

Ticket 1978 say's this was fixed but I'm still unable to create a WAVE file with the original sample used in this ticket:

You can find the samples here: https://www.djxmmx.net/ffmpeg/2304/

ffmpeg -i Bad.mpg -c copy bad.wav
ffmpeg version N-83372-g08b0981 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-li
bmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgs
m --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspe
ex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzi
mg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 46.100 / 55. 46.100
  libavcodec     57. 75.100 / 57. 75.100
  libavformat    57. 66.101 / 57. 66.101
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 72.100 /  6. 72.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[mpeg @ 000000000030a960] Format mpeg detected only with low score of 25, misdetection possible!
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, mpeg, from 'Bad.mpg':
  Duration: 00:04:21.26, start: 0.017378, bitrate: 7386 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tb
r, 90k tbn, 59.94 tbc
    Stream #0:1[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
[wav @ 00000000027700a0] pcm_dvd codec not supported in WAVE format
Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
    Last message repeated 1 times

comment:10 by Elon Musk, 8 years ago

You can not use pcm_dvd codec in wave format. What is not clear about such above message?

comment:11 by Elon Musk, 8 years ago

Resolution: duplicatewontfix

You can not copy/mux incompatible codecs into another container.

comment:12 by andrea, 5 years ago

Resolution: wontfix
Status: closedreopened

Please add ffmpeg support to audio codec
pcm_s16be
into a MP4 container.

Here a sample:
drive.google.com/open?id=1UpxoCLp-N0jEC4pm6u-YTq-ULHz6B0Ho

thanks.

comment:13 by Carl Eugen Hoyos, 5 years ago

Resolution: duplicate
Status: reopenedclosed

comment:14 by Carl Eugen Hoyos, 5 years ago

Resolution: duplicateinvalid
Note: See TracTickets for help on using tickets.