Opened 5 years ago

Closed 5 years ago

#3708 closed defect (fixed)

Incorrect duration shown for wav file?

Reported by: broham Owned by:
Priority: important Component: avformat
Version: git-master Keywords: wav duration regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
I have a wav file that has the incorrect duration in the file properties (in windows Right Click > Properties > Click Details tab) and when I get the duration it shows the incorrect one from the file properties. If I convert the file to an MP3 and then get the duration it shows correctly.

Why is the duration on the wav file incorrect?

Below is how I am getting the duration:

ffprobe test.wav
ffprobe version 2.2.2 Copyright (c) 2007-2014 the FFmpeg developers
  built on May  7 2014 16:26:38 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from 'test.wav':
  Duration: 00:00:02.52, bitrate: 13228 kb/s
    Stream #0:0: Audio: gsm_ms (1[0][0][0] / 0x0031), 8000 Hz, mono, s16, 13 kb/s

Change History (16)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from ffprobe to undetermined

Please current FFmpeg git head, please run ffmpeg -i test.wav -f null - (and post the output) and please provide the file test.wav.

comment:2 follow-up: Changed 5 years ago by broham

Here is the output for: ffmpeg -i test.wav -f null -

ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on May  7 2014 16:26:38 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
  libavutil      52. 66.100 / 52. 66.100
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 33.100 / 55. 33.100
  libavdevice    55. 10.100 / 55. 10.100
  libavfilter     4.  2.100 /  4.  2.100
  libavresample   1.  2.  0 /  1.  2.  0
  libswscale      2.  5.102 /  2.  5.102
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from 'test.wav':
  Duration: 00:00:02.52, bitrate: 13228 kb/s
    Stream #0:0: Audio: gsm_ms (1[0][0][0] / 0x0031), 8000 Hz, mono, s16, 13 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.33.100
    Stream #0:0: Audio: pcm_s16le, 8000 Hz, mono, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (gsm_ms -> pcm_s16le)
Press [q] to stop, [?] for help
size=N/A time=00:42:44.16 bitrate=N/A
video:0kB audio:40065kB subtitle:0 data:0 global headers:0kB muxing overhead -100.000053%

I tried to attach the problem file but it was too large. Can I email it to you?

comment:3 in reply to: ↑ 2 Changed 5 years ago by cehoyos

Replying to broham:

I tried to attach the problem file but it was too large. Can I email it to you?

No, please either upload it to http://www.datafilehost.com/ (100MB limit) or read https://ffmpeg.org/bugreports.html (NO limit).

comment:5 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords wav duration regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Version changed from unspecified to git-master

If there is an issue, it is a regression since f9329946
But I wonder if the file simply contains an invalid duration, do you know how it was created?

comment:6 Changed 5 years ago by jamal

This is probably a duplicate of ticket #3563

comment:7 Changed 5 years ago by broham

No, I don't know how the file was created unfortunately.

comment:8 Changed 5 years ago by broham

Cehoyos, do you know of any work arounds for this problem?

comment:9 Changed 5 years ago by cehoyos

You posted a command line above that shows the actual length of the file and I posted a commit that you could revert to undo the detection of the length written in the wav file.

comment:10 Changed 5 years ago by broham

Ahh, I see now, thanks. Do you know if there is anywhere to download the binaries for this rather than the source?

comment:11 Changed 5 years ago by broham

I tried looking here, but it looks like it only goes back to 5/2011 and f9329946 looks to be from 1/2011

comment:12 follow-up: Changed 5 years ago by broham

So i pulled f9329946 from github, built it and ran it against the problem file but I am getting the same results. Output below:

ffprobe test.wav
FFprobe version git-f932994, Copyright (c) 2007-2011 the FFmpeg developers
  built on Jun 11 2014 08:59:16 with clang 5.1 (clang-503.0.38)
  configuration:
  libavutil     50.36. 0 / 50.36. 0
  libavcore      0.16. 1 /  0.16. 1
  libavcodec    52.108. 0 / 52.108. 0
  libavformat   52.93. 0 / 52.93. 0
  libavdevice   52. 2. 3 / 52. 2. 3
  libavfilter    1.73. 1 /  1.73. 1
  libswscale     0.12. 0 /  0.12. 0
[wav @ 0x7f82fb008000] max_analyze_duration reached
Input #0, wav, from 'test.wav':
  Duration: 00:00:02.52, bitrate: 13228 kb/s
    Stream #0.0: Audio: gsm_ms, 8000 Hz, 1 channels, s16, 13 kb/s

Any idea why it still wouldn't be working?

comment:13 in reply to: ↑ 12 Changed 5 years ago by cehoyos

Replying to broham:

So i pulled f9329946 from github, built it and ran it against the problem file but I am getting the same results.

Which is expected since this is a regression since f9329946
This is an old commit, so the better approach would be to disable reading the fact chunk, the commit should show you what to do.

comment:14 Changed 5 years ago by broham

Hrrm, ok. So i'm a little confused. Would I be changing the hunk of code from here: https://github.com/FFmpeg/FFmpeg/commit/f9329946

back to what it was before and rebuilding? Or is there something I can specify in the command line that will disable reading the fact chunk?

comment:15 Changed 5 years ago by broham

So I'm getting the exact same problem with an MP3 file. Is there a way to tell ffprobe/ffmpeg to ignore the file properties for all file types?

comment:16 Changed 5 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.