Long wave file shortened when converted

Bug #1878083 reported by stefan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SoundConverter
Invalid
High
GautierPortet

Bug Description

I saved a file as 48k 32 bit floating point wav in Ardour and when I converted it to mp3 or flac it cut it off at 1 hour 33min from 2 hours 40min.

stefan (stefan-chirila)
description: updated
Revision history for this message
GautierPortet (kassoulet) wrote :

Hello Stefan,

Can you please retry the conversion after launching SoundConverter like this "soundconverter --debug" in a terminal, and paste here the result.

Thank you,
Gautier.

Changed in soundconverter:
assignee: nobody → GautierPortet (kassoulet)
importance: Undecided → Medium
Changed in soundconverter:
status: New → Confirmed
milestone: none → 3.0.3
importance: Medium → High
Revision history for this message
stefan (stefan-chirila) wrote :

I copied the file to a new folder and once the conversion was finished I checked again. The original is 2h 42 22 and the result is 1h 33 12

stefan@chirilaTOWER:/test1/conversion-test$ soundconverter --debug
SoundConverter 3.0.1
/usr/bin/soundconverter:73: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GLib.threads_init()
  using GTK version: 3.0
  using Gstreamer version: 1.14.4.0
  using gio
/usr/share/soundconverter/python/soundconverter/ui.py:1423: Warning: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' failed
  builder.add_from_file(gladefile)

(SoundConverter:2641): Gtk-WARNING **: 11:25:06.690: ../../../../gtk/gtkliststore.c:836: Unable to convert from (null) to gchararray
analysing file extensions
Queue start: 0 tasks, 8 thread(s).
Queue done in 0.000s (0 tasks)
adding: 0 files
Added 0 files in 0.11s (scan 0.00s, add 0.11s)
analysing file extensions
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" ! decodebin name=decoder ! fakesink'
have_type: audio/x-wav mixdown2_session.wav
mime: .wav audio/x-wav
Queue done in 0.116s (1 tasks)
adding: 1 files
Added 1 files in 0.22s (scan 0.00s, add 0.22s)
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=bitrate cbr=true bitrate=320 ! id3mux ! giosink location="file:///test1/conversion-test/mixdown2_session.wav~379637~SC~"'
found_tags: mixdown2_session.wav
/test1/conversion-test/mixdown2_session.wav~379637~SC~ -> /test1/conversion-test/mixdown2_session.mp3
Creating folder 'file:///test1/conversion-test'?
Queue done in 242.960s (1 tasks)
closing...

Revision history for this message
GautierPortet (kassoulet) wrote :

Thank you very much for your help Stephan.

There is nothing wrong in the log output, but something is definitely not working properly.
Here is a test session: (Fedora 32)

Channels : 2
Sample Rate : 32000
Precision : 16-bit
Duration : 02:19:48.68 = 268437888 samples ~ 629151 CDDA sectors
File Size : 104M
Bit Rate : 99.1k
Sample Encoding: MPEG audio (layer I, II or III)

Channels : 2
Sample Rate : 24000
Precision : 16-bit
Duration : 02:19:48.67 = 201328128 samples ~ 629150 CDDA sectors
File Size : 67.1M
Bit Rate : 64.0k
Sample Encoding: MPEG audio (layer I, II or III)

Channels : 2
Sample Rate : 32000
Precision : 24-bit
Duration : 02:19:48.61 = 268435455 samples ~ 629146 CDDA sectors
File Size : 1.22G
Bit Rate : 1.17M
Sample Encoding: 24-bit FLAC

Channels : 2
Sample Rate : 32000
Precision : 16-bit
Duration : 02:19:48.61 = 268435455 samples ~ 629146 CDDA sectors
File Size : 162M
Bit Rate : 155k
Sample Encoding: Vorbis

All durations seem OK, but the number of samples of the VBR MP3 is wrong, the file is truncated.
Conversion went OK, progress report went to 100%.
The problem is in the VBR MP3 output, as all other formats were OK.

The fact that duration is OK while the file is not complete is due to the Xing header which is set to the expected duration.

Revision history for this message
stefan (stefan-chirila) wrote :

Unfortunately the same thing happens when converting the same file to FLAC (slowest) with no resampling.

The original file is saved as WAV 48k 32bit floating point

---
Terminal output:
---
stefan@chirilaTOWER:/test1/conversion-test$ soundconverter --debug
SoundConverter 3.0.1
/usr/bin/soundconverter:73: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GLib.threads_init()
  using GTK version: 3.0
  using Gstreamer version: 1.14.4.0
  using gio
/usr/share/soundconverter/python/soundconverter/ui.py:1423: Warning: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' failed
  builder.add_from_file(gladefile)

(SoundConverter:24801): Gtk-WARNING **: 12:48:46.855: ../../../../gtk/gtkliststore.c:836: Unable to convert from (null) to gchararray
analysing file extensions
Queue start: 0 tasks, 8 thread(s).
Queue done in 0.000s (0 tasks)
adding: 0 files
Added 0 files in 0.11s (scan 0.00s, add 0.11s)
analysing file extensions
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" ! decodebin name=decoder ! fakesink'
have_type: audio/x-wav mixdown2_session.wav
mime: .wav audio/x-wav
Queue done in 0.116s (1 tasks)
adding: 1 files
Added 1 files in 0.23s (scan 0.00s, add 0.23s)
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! flacenc mid-side-stereo=true quality=8 ! giosink location="file:///test1/conversion-test/mixdown2_session.wav~403272~SC~"'
/test1/conversion-test/mixdown2_session.wav~403272~SC~ -> /test1/conversion-test/mixdown2_session.flac
Creating folder 'file:///test1/conversion-test'?
Queue done in 48.964s (1 tasks)
closing...
¬®°²³´!

Revision history for this message
stefan (stefan-chirila) wrote :

I will upload the file for you to take a look at if you want. It is large 3GB (well it's 2 hours and 40min+) see if there is some anomaly in how Ardour saved it ...

The link is http://stefanchirila.com/upload/soundconverter/mixdown2_session.wav

It is the sound for a screencast I posted on my web site here http://www.stefanchirila.com/blog/2020/05/11/covid19-a-photographers-log-iii-photo-meet-online-with-marko/

Hope this helps

Revision history for this message
stefan (stefan-chirila) wrote :

the file is currently uploading now; it says 50min remaining ...so it'll be available then :)

Revision history for this message
stefan (stefan-chirila) wrote :

Also same thing when converting to a 16bit WAV

--

stefan@chirilaTOWER:/test1/conversion-test$ soundconverter --debug
SoundConverter 3.0.1
/usr/bin/soundconverter:73: PyGIDeprecationWarning: Since version 3.11, calling threads_init is no longer needed. See: https://wiki.gnome.org/PyGObject/Threading
  GLib.threads_init()
  using GTK version: 3.0
  using Gstreamer version: 1.14.4.0
  using gio
/usr/share/soundconverter/python/soundconverter/ui.py:1423: Warning: g_value_type_transformable: assertion 'G_TYPE_IS_VALUE (src_type)' failed
  builder.add_from_file(gladefile)

(SoundConverter:28982): Gtk-WARNING **: 13:04:51.416: ../../../../gtk/gtkliststore.c:836: Unable to convert from (null) to gchararray
analysing file extensions
Queue start: 0 tasks, 8 thread(s).
Queue done in 0.000s (0 tasks)
adding: 0 files
Added 0 files in 0.11s (scan 0.00s, add 0.10s)
analysing file extensions
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" ! decodebin name=decoder ! fakesink'
have_type: audio/x-wav mixdown2_session.wav
mime: .wav audio/x-wav
Queue done in 0.117s (1 tasks)
adding: 1 files
Added 1 files in 0.22s (scan 0.00s, add 0.22s)
Queue start: 1 tasks, 8 thread(s).
launching: 'giosrc location="file:///test1/conversion-test/mixdown2_session.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! audioconvert ! audio/x-raw,format=S16LE ! wavenc ! giosink location="file:///test1/conversion-test/mixdown2_session.wav~442618~SC~"'
found_tags: mixdown2_session.wav
/test1/conversion-test/mixdown2_session.wav~442618~SC~ -> /test1/conversion-test/mixdown2_session.wav
Creating folder 'file:///test1/conversion-test'?
Queue done in 16.182s (1 tasks)
closing...

Revision history for this message
GautierPortet (kassoulet) wrote :

$ gst-launch-1.0 --gst-debug-level=2 giosrc location="file:///home/gautier/tmp/soundconverter/test-16.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=7 ! xingmux ! id3mux ! giosink location="file:///home/gautier/tmp/soundconverter/converted-16.mp3"

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.236601862 103273 0x559f9e4ab1e0 WARN audio-resampler audio-resampler.c:274:convert_taps_gint16_c: can't find exact taps
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:06:26.433190415 103273 0x559f9e4ab1e0 WARN audioencoder gstaudioencoder.c:965:gst_audio_encoder_finish_frame:<lamemp3enc0> Can't copy metadata because input buffer disappeared
Got EOS from element "pipeline0".
Execution ended after 0:06:26.204113882
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

$ gst-launch-1.0 --gst-debug-level=2 giosrc location="file:///home/gautier/tmp/soundconverter/test-32f.wav" name=src ! decodebin name=decoder ! audiorate ! audioconvert ! audioresample ! lamemp3enc encoding-engine-quality=2 target=quality cbr=false quality=7 ! xingmux ! id3mux ! giosink location="file:///home/gautier/tmp/soundconverter/converted-32f.mp3"

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.091674732 103696 0x55b73030b1e0 WARN wavparse gstwavparse.c:1663:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk PEAK
0:00:00.091703870 103696 0x55b73030b1e0 WARN wavparse gstwavparse.c:1307:gst_wavparse_stream_headers:<wavparse0> Invalid size, clipping to 0x7fffffff
0:00:00.091984486 103696 0x55b73030b1e0 WARN wavparse gstwavparse.c:1313:gst_wavparse_stream_headers:<wavparse0> Clipping chunk size to file size
0:00:00.092003281 103696 0x55b73030b1e0 WARN wavparse gstwavparse.c:1663:gst_wavparse_stream_headers:<wavparse0> Ignoring chunk .L.
0:00:00.162266814 103696 0x55b73030b1e0 WARN audio-resampler audio-resampler.c:274:convert_taps_gint16_c: can't find exact taps
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:07:04.638614487 103696 0x55b73030b1e0 WARN audioencoder gstaudioencoder.c:965:gst_audio_encoder_finish_frame:<lamemp3enc0> Can't copy metadata because input buffer disappeared
Got EOS from element "pipeline0".
Execution ended after 0:07:04.480323619
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

There is a chunk of errors when reading big float-32 wavs...

Revision history for this message
GautierPortet (kassoulet) wrote :

And I missed something when testing. It it indeed the wav reader that is faulty. The files are truncated with all output formats.

Changed in soundconverter:
milestone: 3.0.3 → none
Revision history for this message
GautierPortet (kassoulet) wrote :

So yeah, the problem is there:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/blob/master/gst/wavparse/gstwavparse.c#L1308

The maximal size of a RIFF chunk is 4GB, not 2GB.

Filed gstreamer issue: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/730

For now if you are using over 2GB wavs, convert them to FLAC instead.

Changed in soundconverter:
status: Confirmed → Invalid
Revision history for this message
GautierPortet (kassoulet) wrote :

Marking as invalid as this is a GStreamer issue.

Revision history for this message
stefan (stefan-chirila) wrote :

I get the same problem though when I try to convert that file into a FLAC. You mean I should export into Flac from Ardour to begin with?

Revision history for this message
GautierPortet (kassoulet) wrote :

Stephan: yes exactly, export the session to FLAC from Ardour. It is the same quality, and two times smaller. And with the ending :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.