Opened 10 years ago
Last modified 10 years ago
#4214 new defect
Conversion to mp3 changes audio duration
Reported by: | Shahar Mosek | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
When converting PCM files to MP3, I get audio files with different duration than the original. This only happens when the PCM files are mono. Stereo files are converted correctly.
Attachments (5)
Change History (15)
by , 10 years ago
comment:2 by , 10 years ago
Component: | ffmpeg → undetermined |
---|
Why do you think that test.mp3 is 55 seconds long?
It is actually over a minute long (like the wav file that you attached).
comment:3 by , 10 years ago
The actual audio is indeed 1 minute, but if you look at it in Windows Explorer or Windows Media Player, the duration is displayed as 55 seconds.
comment:6 by , 10 years ago
If vlc, MPlayer, xine, totem and FFmpeg show the correct duration but WMP shows the wrong duration, I would suspect that the bug is in WMP.
Please test -write_xing 0
, this may be a work-around.
comment:7 by , 10 years ago
VLC does not really show the correct duration. It shows the wrong duration, but gradually adjusts the duration until it reaches the correct one.
The work-around does work, however, but it is not helpful, since I need the calls to play in HTML5 player on IE, and it does not play MP3 files without the XING header.
comment:8 by , 10 years ago
This appears to be the same problem as https://trac.ffmpeg.org/ticket/2697.
comment:9 by , 10 years ago
Next step would be to manually check the duration value which is written into the Xing header, its very well possible that it might be writing a wrong value. If the written value is correct, than thats another story.
comment:10 by , 10 years ago
I don't see a duration value in the XING header.
I did find that when writing the XING header, the XING frame has a bitrate of 24kbps, while the rest of the frames have a bitrate of 8 kbps. This goes well with the fact that opening the audio in an HTML5 player in IE shows a length of 20 seconds for the audio (instead of 1 minute).
If I manually modify this bitrate to 8kbps, the audio duration is correct in the HTML5 player.
I believe FFMPEG writes the XING frame as though the audio was stereo even if it is mono audio, which is the cause of the problem. This also explains why the problem is not seen with stereo calls.
PCM file. Duration is 1 minute.