Ticket #2070 (reopened enhancement)

Opened 5 months ago

Last modified 4 months ago

Handling Multichannel BINK

Reported by: DJX Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: bink
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
I have a BINK video that has three audio streams. I believe this is because it is used in a surround sound environment. I would like to purpose a change to the way FFmpeg handles these types of files. In this case, they should all be mixed together to produce the correct audio output. Currently, on a two channel system, it is missing a lot of the audio.

Additionally, as a work around, I tried the "amerge" filter but it does not allow for this type of conversion because the file has more then two audio streams.

FFmpeg & FFplay should be considered here.

How to reproduce:

ffmpeg -i "flashpoint_load.bik"
ffmpeg version N-48228-gceee440 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec 27 2012 02:02:43 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-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --e
nable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --e
nable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil      52. 12.100 / 52. 12.100
  libavcodec     54. 81.100 / 54. 81.100
  libavformat    54. 50.102 / 54. 50.102
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 30.101 /  3. 30.101
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, bink, from 'flashpoint_load.bik':
  Duration: 00:00:43.77, start: 0.000000, bitrate: 6393 kb/s
    Stream #0:0: Video: binkvideo (BIKi / 0x694B4942), yuv420p, 1280x720, 30 tbr
, 30 tbn, 30 tbc
    Stream #0:1: Audio: binkaudio_dct, 48000 Hz, stereo, fltp
    Stream #0:2: Audio: binkaudio_dct, 48000 Hz, mono, fltp
    Stream #0:3: Audio: binkaudio_dct, 48000 Hz, stereo, fltp
At least one output file must be specified

Change History

comment:2 Changed 5 months ago by cehoyos

I may misunderstand your issue but the following works as expected here:
$ ffmpeg -i flashpoint_load.bik -filter_complex amerge=inputs=3 out.wav

comment:3 Changed 5 months ago by DJX

Your command works, thanks.
I was actualy thinking that these are handled wrong since, in this sample at least, all the channels are supposed to be mixed to produce the correct output. I may be wrong here though. Feel free to close if you want since I have a work around now.

Also, the "amerge" option is not avaliable in FFplay.

comment:4 Changed 4 months ago by richardpl

  • Status changed from new to closed
  • Resolution set to invalid

comment:5 Changed 4 months ago by cehoyos

Could you elaborate on why this is an invalid ticket?
Imo, the demuxer should set some metadata that the amerge filter has to be inserted for correct output, just as for tickets #162 and #1484.
Or are there bink samples with multiple audio streams that should be interpreted differently? Could this be signaled in the stream?

comment:6 Changed 4 months ago by cehoyos

  • Status changed from closed to reopened
  • Type changed from defect to enhancement
  • Component changed from undetermined to avformat
  • Priority changed from normal to wish
  • Version changed from unspecified to git-master
  • Keywords bink added
  • Resolution invalid deleted

I believe this can be improved.

comment:7 Changed 4 months ago by richardpl

How?

Version 0, edited 4 months ago by richardpl (next)

comment:8 Changed 4 months ago by cehoyos

I believe that similarly to ticket #1764 the channel layout setting can be improved.
The improved setting could then be used by applications.

Note: See TracTickets for help on using tickets.