Opened 9 years ago

Closed 9 years ago

#838 closed defect (fixed)

ffplay: remix by defaul multichannel audio to stereo

Reported by: ami_stuff Owned by: cus
Priority: normal Component: ffplay
Version: git-master Keywords: sdl
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: yes


C:\>ffplay 8_Channel_ID_TrueTypeAudio.tta
ffplay version N-36193-gf514695, Copyright (c) 2003-2011 the FFmpeg developers
  built on Dec 26 2011 17:50:37 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      51. 33.100 / 51. 33.100
  libavcodec     53. 48.100 / 53. 48.100
  libavformat    53. 28.100 / 53. 28.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 54.100 /  2. 54.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  5.100 /  0.  5.100
  libpostproc    51.  2.100 / 51.  2.100
Input #0, tta, from '8_Channel_ID_TrueTypeAudio.tta':
  Duration: 00:00:08.04, start: 0.000000, bitrate: 1584 kb/s
    Stream #0:0: Audio: tta, 48000 Hz, 7.1(wide), s32
SDL_OpenAudio: 1 (mono) and 2 (stereo) channels supported
8_Channel_ID_TrueTypeAudio.tta: could not open codecs

Change History (4)

comment:1 follow-up: Changed 9 years ago by cus

  • Analyzed by developer set
  • Cc added
  • Component changed from undetermined to FFplay
  • Owner set to cus
  • Status changed from new to open
  • Version changed from unspecified to git-master

Actually SDL does support 6 channel or 4 channel audio output, the problem is that you are using 8 channel audio.

I plan a fix for this which will set the desired number of channels with the following algorithm:

  • SDL_getenv("SDL_AUDIO_CHANNELS") if the environment variable is set
  • otherwise set 2, 4 or 6 channels depending on the number of channels in the input

comment:2 Changed 9 years ago by ami_stuff

That's ok. Another problem is that sdl plays incorrectly high audio frequencies.

ffmpeg -i test.wav -ar 48000 out.wav
ffplay out.wav - this plays ok

ffmpeg -i test.wav -ar 96000 out.wav
ffplay out.wav - this doesn't

maybe you can fix it too by adding a check
if ar>48000 then resample audio to 48000?

comment:3 in reply to: ↑ 1 Changed 9 years ago by cehoyos

  • Keywords sdl added

Replying to cus:

Actually SDL does support 6 channel or 4 channel audio output, the problem is that you are using 8 channel audio.

A possibly related problem is that old SDL versions (like 1.2.13) produce very broken output for channels > 2.
Or in other words: I can reproduce tickets #318 and #319, but I suspect they work fine for you...

comment:4 Changed 9 years ago by cus

  • Resolution set to fixed
  • Status changed from open to closed

The original bug is fixed in the latest git master. (Altough the sample crashes for me due to an invalid write in tta_decode_frame, but I think that is another issue).

Regarding your other audio problems - I have not experienced them (neither the frequency problem with 96 KHz, nor the issues mentioned in ticket 318 and 319), If you still have them, try to figure out if they are related to a particular SDL version or OS, maybe SDL_audiodriver, and open a new ticket for the frequency problem.

Note: See TracTickets for help on using tickets.