Opened 4 years ago

Last modified 4 years ago

#3783 new defect

ffmpeg should init decoders before filters

Reported by: Cigaes Owned by:
Priority: minor Component: ffmpeg
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

./ffmpeg_g -lavfi sine -t 5 -y /tmp/test.ac3
./ffmpeg_g -c ac3_fixed -i /tmp/test.ac3 -f null -
ffmpeg version N-64757-g277e5ca Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 18 2014 10:43:46 with gcc 4.9 (Debian 4.9.0-7)
  configuration: --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libopus --enable-libass --enable-libfreetype --assert-level=2
  libavutil      52. 92.101 / 52. 92.101
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.101 / 55. 48.101
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.102 /  4. 11.102
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
[ac3 @ 0xfc8cc0] Estimating duration from bitrate, this may be inaccurate
Input #0, ac3, from '/tmp/test.ac3':
  Duration: 00:00:05.02, start: 0.000000, bitrate: 96 kb/s
    Stream #0:0: Audio: ac3, 44100 Hz, mono, fltp, 96 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.48.101
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
    Metadata:
      encoder         : Lavc55.69.100 pcm_s16le
Stream mapping:
  Stream #0:0 -> #0:0 (ac3 (ac3_fixed) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Input stream #0:0 frame changed from rate:44100 fmt:fltp ch:1 chl:mono to rate:44100 fmt:s16p ch:1 chl:mono
size=N/A time=00:00:05.01 bitrate=N/A    
video:0kB audio:432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Notice this particular line:

Input stream #0:0 frame changed from rate:44100 fmt:fltp ch:1 chl:mono to rate:44100 fmt:s16p ch:1 chl:mono

This happens because filters are initialized before decoders: some properties of the stream, especially the sample format, often depend on the decoder. If a different decoder is used for decoding than the one used for probing, the result is considered a change in format. This is handled correctly but gives wrong information and wastes resources.

Change History (1)

comment:1 Changed 4 years ago by ubitux

  • Summary changed from ffmpeg shoud init decoders before filters to ffmpeg should init decoders before filters
Note: See TracTickets for help on using tickets.