Opened 7 years ago

Closed 5 years ago

#5931 closed defect (fixed)

showwavespic, showspectrumpic innacurate length of resulting image

Reported by: Jonatã Bolzan Loss Owned by:
Priority: minor Component: avfilter
Version: git-master Keywords: showwavespic
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:showwavespic, showspectrumpic innacurate length of resulting image
How to reproduce:

ffmpeg -i voice.wav -lavfi  showwavespic=scale=log:s=1000x180 waveform.png

In this example, the waveform is rendered correctly (end of waveform on image1.png). But if we increase the with to 10000, the end of waveform have an extra gap (end of waveform on image2.png).

ffmpeg -i voice.wav -lavfi  showwavespic=scale=log:s=10000x180 waveform.png

Attachments (10)

image1.png (16.1 KB ) - added by Jonatã Bolzan Loss 7 years ago.
image1
image2.png (14.0 KB ) - added by Jonatã Bolzan Loss 7 years ago.
voice.wav (1.2 MB ) - added by Jonatã Bolzan Loss 7 years ago.
generate-waveform.zip (80.1 KB ) - added by Rudolf Enberg 7 years ago.
Example of rendering a waveform with a one second audio file
ffmpeg-20180629-213108.log (143.0 KB ) - added by Marcel 6 years ago.
45sec audio waveform render
45sec_sine_stereo_test_6000x500.png (13.7 KB ) - added by Marcel 6 years ago.
45sec audio waveform render
45sec_sine_stereo_test.flac (1.7 MB ) - added by Marcel 6 years ago.
45sec audio waveform render
ffmpeg-20180629-204841.log (11.9 KB ) - added by Marcel 6 years ago.
2.4sec audio waveform render
jimi20_2560x1440.png (529.8 KB ) - added by Marcel 6 years ago.
2.4sec audio waveform render
jimi20.wav (208.5 KB ) - added by Marcel 6 years ago.
2.4sec audio waveform render

Change History (17)

by Jonatã Bolzan Loss, 7 years ago

Attachment: image1.png added

image1

by Jonatã Bolzan Loss, 7 years ago

Attachment: image2.png added

by Jonatã Bolzan Loss, 7 years ago

Attachment: voice.wav added

comment:1 by Carl Eugen Hoyos, 7 years ago

Keywords: showwavespic added
Priority: normalminor
Status: newopen

Afaict, there is always a right border (without waves), even for small width (at least for a width of 1000 for the given sample). I don't know if this is intended or not.

comment:2 by Rudolf Enberg, 7 years ago

It appears the shorter your audio is, the bigger the gap can get. Rendering a one second WAV into a 1000px wide image leaves 20 pixels empty on the right. This is not a trivial amount of error. I'll try upload a simple test case.

by Rudolf Enberg, 7 years ago

Attachment: generate-waveform.zip added

Example of rendering a waveform with a one second audio file

comment:3 by Elon Musk, 6 years ago

Resolution: wontfix
Status: openclosed

comment:4 by Marcel, 6 years ago

Cc: marcel@soundplant.org added
Resolution: wontfix
Status: closedreopened

Why was this set to 'wontfix'? If there are any further infos/details needed to get this fixed I'd be happy to provide. I have been running into this issue a bunch recently on the latest build (ffmpeg-20180619-a990184) and it is a pretty nasty bug, making features that are 95% complete basically useless due to unreliability/inaccuracy. PNGs end up with anywhere from 1 to 300+ empty pixels on the right and there's no way to know which empty pixels are due to the bug and which are due to actual silence in the input audio. Does anyone know any way to work around this bug, like if there is some magic number for the .png dimensions that makes ffmpeg happy, or some way to calculate how many of the blank pixels are erroneous (is it a function of the length of the audio)?

Last edited 6 years ago by Marcel (previous) (diff)

comment:5 by Marcel, 6 years ago

Cc: marcel@soundplant.org removed

by Marcel, 6 years ago

Attachment: ffmpeg-20180629-213108.log added

45sec audio waveform render

by Marcel, 6 years ago

45sec audio waveform render

by Marcel, 6 years ago

Attachment: 45sec_sine_stereo_test.flac added

45sec audio waveform render

by Marcel, 6 years ago

Attachment: ffmpeg-20180629-204841.log added

2.4sec audio waveform render

by Marcel, 6 years ago

Attachment: jimi20_2560x1440.png added

2.4sec audio waveform render

by Marcel, 6 years ago

Attachment: jimi20.wav added

2.4sec audio waveform render

comment:6 by Marcel, 6 years ago

I've just attached some more explicit examples, including ffmpeg log files, input audio files, and output pngs, in the hopes that this helps:

jimi20_2560x1440.png - Attempt to render a 2560x1440 png of a 2.42 seconds mono wav file jimi20.wav (loud drum sample with no silence). The resulting png contains a 2540px wide waveform plus a 20px wide section of erroneous empty pixels. Logfile ffmpeg-20180629-204841.log

45sec_sine_stereo_test_6000x500.png - Attempt to render a 6000x500 png of a 45 seconds stereo flac file 45sec_sine_stereo_test.flac (simple sine tone, no silence). The resulting png contains a 5995px wide waveform plus a 5px wide section of erroneous empty pixels. Logfile ffmpeg-20180629-213108.log​

Last edited 6 years ago by Marcel (previous) (diff)

comment:7 by Elon Musk, 5 years ago

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.