[FFmpeg-trac] #7543(avfilter:new): showwavespic complex filter with alphamerge never completes

FFmpeg trac at avcodec.org
Sun Nov 11 03:44:43 EET 2018


#7543: showwavespic complex filter with alphamerge never completes
----------------------------------+--------------------------------------
             Reporter:  ajbeach2  |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  avfilter  |                  Version:  git-master
             Keywords:  waveform  |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 Summary of the bug:

 The following command works on ffmpeg 3.2. I have not tested this on any
 other versions except for head. On the snapshot release of ffmpeg, the
 following command never completes. What this is doing: is creating a
 waveform pic with a black background, and a transparent waveform (alpha 0)
 from an mp3. This has failed on all mp3 files i have tired.


 {{{
 ffmpeg -v verbose -y -vn -i song.mp3 \
     -filter_complex \
        "[0:a]aformat=channel_layouts=mono,compand=gain=-6, \
         showwavespic=s=600x120:colors=white,negate[a]; \
         color=black:600x120[c]; \
         [c][a]alphamerge"  -vframes 1 song.png
 }}}


 ffmpeg just hangs, with this output:

 {{{
 Output #0, image2, to 'song.png':
   Metadata:
     TBPM            : 114
     encoded_by      : LAME in FL Studio 11
     date            : 2015
     encoder         : Lavf58.22.100
     Stream #0:0: Video: png, 1 reference frame, rgba, 600x120 [SAR 1:1 DAR
 5:1], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
     Metadata:
       encoder         : Lavc58.39.100 png
 frame=    0 fps=0.0 q=0.0 size=N/A time=00:00:00.00 bitrate=N/A speed=
 0x
 }}}


 Here is the more detailed report:

 {{{
 ffmpeg -report -v 9 -loglevel 99 -y -vn -i song.mp3 \
             -filter_complex \
                "[0:a]aformat=channel_layouts=mono,compand=gain=-6, \
                 showwavespic=s=600x120:colors=white,negate[a]; \
                 color=black:600x120[c]; \
                 [c][a]alphamerge"  -vframes 1 song.png
 ffmpeg started on 2018-11-11 at 01:29:38
 Report written to "ffmpeg-20181111-012938.log"
 ffmpeg version N-92397-g27e114b Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
   configuration: --prefix=/home/circleci/ffmpeg_build --pkg-config-
 flags=--static --extra-cflags=-I/home/circleci/ffmpeg_build/include
 --extra-ldflags=-L/home/circleci/ffmpeg_build/lib
 --bindir=/home/circleci/bin --enable-gpl --enable-libx264 --enable-
 libmp3lame --enable-nonfree --enable-libfdk-aac --enable-pthreads
   libavutil      56. 23.101 / 56. 23.101
   libavcodec     58. 39.100 / 58. 39.100
   libavformat    58. 22.100 / 58. 22.100
   libavdevice    58.  6.100 / 58.  6.100
   libavfilter     7. 43.100 /  7. 43.100
   libswscale      5.  4.100 /  5.  4.100
   libswresample   3.  4.100 /  3.  4.100
   libpostproc    55.  4.100 / 55.  4.100
 Splitting the commandline.
 Reading option '-report' ... matched as option 'report' (generate a
 report) with argument '1'.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument '9'.
 Reading option '-loglevel' ... matched as option 'loglevel' (set logging
 level) with argument '99'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option '-vn' ... matched as option 'vn' (disable video) with
 argument '1'.
 Reading option '-i' ... matched as input url with argument 'song.mp3'.
 Reading option '-filter_complex' ... matched as option 'filter_complex'
 (create a complex filtergraph) with argument
 '[0:a]aformat=channel_layouts=mono,compand=gain=-6,
 showwavespic=s=600x120:colors=white,negate[a];
 color=black:600x120[c];         [c][a]alphamerge'.
 Reading option '-vframes' ... matched as option 'vframes' (set the number
 of video frames to output) with argument '1'.
 Reading option 'song.png' ... matched as output url.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option report (generate a report) with argument 1.
 Applying option v (set logging level) with argument 9.
 Applying option y (overwrite output files) with argument 1.
 Applying option filter_complex (create a complex filtergraph) with
 argument [0:a]aformat=channel_layouts=mono,compand=gain=-6,
 showwavespic=s=600x120:colors=white,negate[a];
 color=black:600x120[c];         [c][a]alphamerge.
 Successfully parsed a group of options.
 Parsing a group of options: input url song.mp3.
 Applying option vn (disable video) with argument 1.
 Successfully parsed a group of options.
 Opening an input file: song.mp3.
 [NULL @ 0x55b45d65d8c0] Opening 'song.mp3' for reading
 [file @ 0x55b45d65e340] Setting default whitelist 'file,crypto'
 Probing mp3 score:1 size:1978
 Probing mp3 score:25 size:4026
 Probing mp3 score:51 size:8122
 [mp3 @ 0x55b45d65d8c0] Format mp3 probed with size=8192 and score=51
 id3v2 ver:3 flags:00 len:60
 [mp3 @ 0x55b45d65d8c0] Skipping 0 bytes of junk at 70.
 [mp3 @ 0x55b45d65d8c0] Before avformat_find_stream_info() pos: 70 bytes
 read:32768 seeks:0 nb_streams:1
 [mp3 @ 0x55b45d65d8c0] All info found
 [mp3 @ 0x55b45d65d8c0] Estimating duration from bitrate, this may be
 inaccurate
 [mp3 @ 0x55b45d65d8c0] stream 0: start_time: 0.000 duration: 265.091
 [mp3 @ 0x55b45d65d8c0] format: start_time: 0.000 duration: 265.091
 bitrate=320 kb/s
 [mp3 @ 0x55b45d65d8c0] After avformat_find_stream_info() pos: 53318 bytes
 read:65536 seeks:0 frames:50
 Input #0, mp3, from 'song.mp3':
   Metadata:
     TBPM            : 114
     encoded_by      : LAME in FL Studio 11
     date            : 2015
   Duration: 00:04:25.09, start: 0.000000, bitrate: 320 kb/s
     Stream #0:0, 50, 1/14112000: Audio: mp3, 44100 Hz, stereo, fltp, 320
 kb/s
 Successfully opened the file.
 [Parsed_aformat_0 @ 0x55b45d685780] Setting 'channel_layouts' to value
 'mono'
 [Parsed_compand_1 @ 0x55b45d660940] Setting 'gain' to value '-6'
 [Parsed_showwavespic_2 @ 0x55b45d662600] Setting 's' to value '600x120'
 [Parsed_showwavespic_2 @ 0x55b45d662600] Setting 'colors' to value 'white'
 [Parsed_negate_3 @ 0x55b45d663100] negate_alpha:0
 [Parsed_color_4 @ 0x55b45d660400] Setting 'color' to value 'black'
 [Parsed_color_4 @ 0x55b45d660400] Setting 'size' to value '600x120'
 [Parsed_color_4 @ 0x55b45d660400] size:600x120 rate:25/1
 duration:-1.000000 sar:1/1
 Parsing a group of options: output url song.png.
 Applying option vframes (set the number of video frames to output) with
 argument 1.
 Successfully parsed a group of options.
 Opening an output file: song.png.
 Successfully opened the file.
 Stream mapping:
   Stream #0:0 (mp3float) -> aformat
   alphamerge -> Stream #0:0 (png)
 Press [q] to stop, [?] for help
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
 detected 2 logical cores
 [Parsed_aformat_0 @ 0x55b45d65d3c0] Setting 'channel_layouts' to value
 'mono'
 [Parsed_compand_1 @ 0x55b45d675b80] Setting 'gain' to value '-6'
 [Parsed_showwavespic_2 @ 0x55b45d68eac0] Setting 's' to value '600x120'
 [Parsed_showwavespic_2 @ 0x55b45d68eac0] Setting 'colors' to value 'white'
 [Parsed_negate_3 @ 0x55b45d68f500] negate_alpha:0
 [Parsed_color_4 @ 0x55b45d676300] Setting 'color' to value 'black'
 [Parsed_color_4 @ 0x55b45d676300] Setting 'size' to value '600x120'
 [Parsed_color_4 @ 0x55b45d676300] size:600x120 rate:25/1
 duration:-1.000000 sar:1/1
 [graph_0_in_0_0 @ 0x55b45d676440] Setting 'time_base' to value '1/44100'
 [graph_0_in_0_0 @ 0x55b45d676440] Setting 'sample_rate' to value '44100'
 [graph_0_in_0_0 @ 0x55b45d676440] Setting 'sample_fmt' to value 'fltp'
 [graph_0_in_0_0 @ 0x55b45d676440] Setting 'channel_layout' to value '0x3'
 [graph_0_in_0_0 @ 0x55b45d676440] tb:1/44100 samplefmt:fltp
 samplerate:44100 chlayout:0x3
 [format @ 0x55b45d65f900] Setting 'pix_fmts' to value
 'rgb24|rgba|rgb48be|rgba64be|pal8|gray|ya8|gray16be|ya16be|monob'
 [Parsed_aformat_0 @ 0x55b45d65d3c0] auto-inserting filter
 'auto_resampler_0' between the filter 'graph_0_in_0_0' and the filter
 'Parsed_aformat_0'
 [Parsed_showwavespic_2 @ 0x55b45d68eac0] auto-inserting filter
 'auto_resampler_1' between the filter 'Parsed_compand_1' and the filter
 'Parsed_showwavespic_2'
 [AVFilterGraph @ 0x55b45d660740] query_formats: 9 queried, 9 merged, 6
 already done, 0 delayed
 [auto_resampler_0 @ 0x55b45d712240] [SWR @ 0x55b45d712740] Using fltp
 internally between filters
 [auto_resampler_0 @ 0x55b45d712240] [SWR @ 0x55b45d712740] Matrix
 coefficients:
 [auto_resampler_0 @ 0x55b45d712240] [SWR @ 0x55b45d712740] FC: FL:0.707107
 FR:0.707107
 [auto_resampler_0 @ 0x55b45d712240] ch:2 chl:stereo fmt:fltp r:44100Hz ->
 ch:1 chl:mono fmt:dblp r:44100Hz
 [Parsed_compand_1 @ 0x55b45d675b80] 0: x=-70.000000 y=0.000000
 [Parsed_compand_1 @ 0x55b45d675b80] 1: x=-60.000000 y=40.000000
 [Parsed_compand_1 @ 0x55b45d675b80] 2: x=1.000000 y=-1.000000
 [auto_resampler_1 @ 0x55b45d728480] [SWR @ 0x55b45d728940] Using dblp
 internally between filters
 [auto_resampler_1 @ 0x55b45d728480] ch:1 chl:mono fmt:dblp r:44100Hz ->
 ch:1 chl:mono fmt:s16 r:44100Hz
 [Parsed_showwavespic_2 @ 0x55b45d68eac0] s:600x120 r:73.500000 n:1
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][0] = 255
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][1] = 254
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][2] = 253
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][3] = 252
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][4] = 251
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][5] = 250
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][6] = 249
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][7] = 248
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][8] = 247
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][9] = 246
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][10] = 245
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][11] = 244
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][12] = 243
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][13] = 242
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][14] = 241
 [Parsed_negate_3 @ 0x55b45d68f500] val[0][15] = 240

 ....
 eventually this is parsed
 }}}

 After that: the report gets stuck:

 {{{
 Output #0, image2, to 'song.png':
   Metadata:
     TBPM            : 114
     encoded_by      : LAME in FL Studio 11
     date            : 2015
     encoder         : Lavf58.22.100
     Stream #0:0, 0, 1/25: Video: png, 1 reference frame, rgba, 600x120
 [SAR 1:1 DAR 5:1], 0/1, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
     Metadata:
       encoder         : Lavc58.39.100 png
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
 [Parsed_alphamerge_5 @ 0x55b45d70f780] Copying data in avfilter.
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 420 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 392 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 421 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 380 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 391 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 314 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 390 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 384 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 408 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 421 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 394 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 490 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 428 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 406 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 359 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 196 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 164 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 178 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 208 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 338 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 493 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 448 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 468 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 426 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 280 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 259 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 298 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 256 times
 cur_dts is invalid (this is harmless if it occurs once at the start per
 stream)
     Last message repeated 108 times
 [Parsed_showwavespic_2 @ 0x55b45d68eac0] Create frame averaging 19484
 samples per column
 }}}





 I have created a github repo with more details, and files to test against.
 Included in the github repo is the report file, and the output of the
 command. I have also provided a docker image that demonstrates the issue.
 There is a compile-ffmpeg.sh script in the repo that was used to compile
 ffmpeg. This is using the http://ffmpeg.org/releases/ffmpeg-
 snapshot.tar.bz2 release of ffmpeg

 https://github.com/ajbeach2/go-pyhton-ci

 This is the mp3 I tested against:
 https://github.com/ajbeach2/go-pyhton-ci/raw/master/song.mp3

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7543>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list