INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: File truncation when converting to mp3  (Read 3220 times)

DJLegba

  • Citizen of the Universe
  • *****
  • Posts: 995
File truncation when converting to mp3
« on: September 15, 2016, 12:15:21 pm »

When MC converts consecutive tracks to mp3 the first couple of seconds of tracks after the first are lost. MC 22.021.

This problem is easy to reproduce. Set up an MC client and configure it to always convert audio to mp3. Play an opera from the the master library. Opera recordings have no silence between most tracks (within an act), so the discontinuity is very easy to hear.

The problem does not happen when the MC client is set to convert to PCM 16 bit. It also has nothing to do with any gapless settings, as the discontinuities only happen when the client converts to MP3. When playing with no conversion, or converting to PCM 16 or 24 bit the first tracks plays to the end and nothing is skipped on the next track.

The problem happens regardless of the SoX setting.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: File truncation when converting to mp3
« Reply #1 on: September 20, 2016, 11:53:42 am »

I've been communicating with DJLegba about this outside of the thread.  I'm not sure what's going on because I can't test exactly like he is testing.  However, one of my tests revealed a surprise, which indicates that MC is probably not doing the right thing with MP3s.  Though I'm not 100% sure.

When converting from FLAC to MP3, the resulting MP3s are longer than the original FLAC files.  Here's some raw data from Media info of a track, first as as MP3 (converted by MC), then as the original FLAC:

Code: [Select]
BLG:backups blgentry$ mediainfo -f  ~/Music/To\ Be\ Thrown\ Away/PF/02_Breathe.mp3 |grep -i duration
Duration                                 : 165564
Duration                                 : 2mn 45s
Duration                                 : 2mn 45s 564ms
Duration                                 : 2mn 45s
Duration                                 : 00:02:45.564
Duration                                 : 00:02:45.564
Duration                                 : 165694
Duration                                 : 2mn 45s
Duration                                 : 2mn 45s 694ms
Duration                                 : 2mn 45s
Duration                                 : 00:02:45.694
Duration                                 : 00:02:45.694
BLG:backups blgentry$ mediainfo -f ~/Music/FLAC/Pink\ Floyd/The\ Dark\ Side\ Of\ The\ Moon\ \(MFSL\ UDCD\ 517\)/02_Breathe.flac |grep -i duration
Duration                                 : 165533
Duration                                 : 2mn 45s
Duration                                 : 2mn 45s 533ms
Duration                                 : 2mn 45s
Duration                                 : 00:02:45.533
Duration                                 : 00:02:45.533
Duration                                 : 165533
Duration                                 : 2mn 45s
Duration                                 : 2mn 45s 533ms
Duration                                 : 2mn 45s
Duration                                 : 00:02:45.533
Duration                                 : 00:02:45.533

In this case, a 31 mS difference.  In another case, it was 42 mS.

This difference in length is easy to see in Audacity.  See attached screen shot.  On closer examination, the MP3 is both longer *and* truncated!  Take a close look at the waveforms.  I don't think there's anything weird with my testing methodology.  I just did Library > Convert to make MP3s.  No DSP options.  320 kpbs, constant with "limit to constant" set.

Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: File truncation when converting to mp3
« Reply #2 on: September 20, 2016, 12:10:31 pm »

A little more info:

The beginning of the converted MP3 track has some silence.  But that silence is not there in the FLAC version.  See attached screen shot.  So, we have roughly 51 mS of silence in the beginning, but the end is only 31 mS past the end of the FLAC file.

Which means we have a small "gap" in the beginning, and a small truncation at the end (roughly 20 mS in this case, as 51 - 31 = 20).

Brian.
Logged

DJLegba

  • Citizen of the Universe
  • *****
  • Posts: 995
Re: File truncation when converting to mp3
« Reply #3 on: September 20, 2016, 12:17:49 pm »

I noticed that converted files ended too soon back in May, but unfortunately I posted it at the end of someone else's thread instead of starting my own:

http://yabb.jriver.com/interact/index.php/topic,104068.msg728410.html#msg728410

The odd thing when listening to mp3s converted on the fly (by Gizmo or by MC) is that the tracks seem to end properly but the start of the next track is missing. In any event, something is clearly wrong with FLAC to mp3 conversion.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: File truncation when converting to mp3
« Reply #4 on: November 15, 2016, 11:50:01 am »

I just converted a couple gapless DSF files we have sitting around into MP3.  As far as I could tell, the output was perfectly gapless too.

So I'm not sure how to reproduce the problem.
Logged
Matt Ashland, JRiver Media Center

DJLegba

  • Citizen of the Universe
  • *****
  • Posts: 995
Re: File truncation when converting to mp3
« Reply #5 on: November 15, 2016, 12:09:02 pm »

I just converted a couple gapless DSF files we have sitting around into MP3.  As far as I could tell, the output was perfectly gapless too.

So I'm not sure how to reproduce the problem.

The files don't need to be DSF. Both Brian and I were converting FLAC files. Did you try to follow what Brian did?
Logged
Pages: [1]   Go Up