Opened 4 years ago

Closed 3 years ago

#1796 closed defect (fixed)

Unable to extract PCM audio track from AVI file

Reported by: tom_bogle Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: dvvideo avi regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug: I have an AVI-wrapped dvvideo file with a single pcm_s16le audio track. The video plays fine (although there is a funny noise at the start that might indicate some kind of corruption or encoding problem). I am able to extract the audio using MPlayer, and ffmpeg can successfully produce a lower-quality avi file and extract the audio as mp3. I am able to run ffmpeg a second time to get a WAV file from either of these. However, if I simply try to extract the audio track directly into a WAV file from the original AVI file, all I get is 0.03 seconds of noise. There is no error message, so the software I'm writing that is running ffmpeg and monitoring the output can't tell anything went wrong.

How to reproduce:

% ffmpeg -i TruncatedPCMAudio.avi -vn -acodec copy temp.wav
  - OR -
% ffmpeg -i TruncatedPCMAudio.avi -vn -acodec pcm_s16le temp.wav
ffmpeg version N-40126-ga4b58fd
built on Apr 26 2012 03:29:50 with gcc 4.6.3

ffmpeg -v 9 -loglevel 99 -i TruncatedPCMAudio.avi
ffmpeg version N-40126-ga4b58fd Copyright (c) 2000-2012 the FFmpeg developers

built on Apr 26 2012 03:29:50 with gcc 4.6.3
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru

ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass

--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable

-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --e
nable-zlib

libavutil 51. 47.100 / 51. 47.100
libavcodec 54. 15.100 / 54. 15.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 72.100 / 2. 72.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 11.100 / 0. 11.100
libpostproc 52. 0.100 / 52. 0.100

[avi @ 01d3c020] Format avi probed with size=2048 and score=100
[AVI demuxer @ 01d3c680] use odml:1
[avi @ 01d3c020] File position before avformat_find_stream_info() is 32768
[avi @ 01d3c020] All info found
[avi @ 01d3c020] File position after avformat_find_stream_info() is 185032
Input #0, avi, from 'TruncatedPCMAudio.avi':

Duration: 00:03:52.46, start: 0.000000, bitrate: 28855 kb/s

Stream #0:0, 1, 1001/30000: Video: dvvideo, yuv411p, 720x480, 1001/30000, 28

771 kb/s, SAR 8:9 DAR 4:3, 29.97 tbr, 29.97 tbn, 29.97 tbc

Stream #0:1, 1, 1/30000: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 k

b/s
At least one output file must be specified

Attachments (1)

TruncatedPCMAudio_smallsample.avi (2.4 MB) - added by tom_bogle 4 years ago.
AVI File illustrating problem when audi is extracted

Change History (7)

Changed 4 years ago by tom_bogle

AVI File illustrating problem when audi is extracted

comment:1 Changed 4 years ago by cehoyos

Please provide the complete, uncut console output of
$ ffmpeg -i yourfile out.wav

comment:2 Changed 4 years ago by tom_bogle

Here is the complete output when I run that command against my original, full-length AVI file:

ffmpeg -i TruncatedPCMAudio.avi out.wav

ffmpeg version N-40126-ga4b58fd Copyright (c) 2000-2012 the FFmpeg developers

built on Apr 26 2012 03:29:50 with gcc 4.6.3
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru

ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass

--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable

-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --e
nable-zlib

libavutil 51. 47.100 / 51. 47.100
libavcodec 54. 15.100 / 54. 15.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 72.100 / 2. 72.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 11.100 / 0. 11.100
libpostproc 52. 0.100 / 52. 0.100

Input #0, avi, from 'TruncatedPCMAudio.avi':

Duration: 00:03:52.46, start: 0.000000, bitrate: 28855 kb/s

Stream #0:0: Video: dvvideo, yuv411p, 720x480, 28771 kb/s, SAR 8:9 DAR 4:3,

29.97 tbr, 29.97 tbn, 29.97 tbc

Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s

Guessed Channel Layout for Input Stream #0.1 : stereo
Output #0, wav, to 'out.wav':

Metadata:

encoder : Lavf54.3.100
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16

, 1536 kb/s
Stream mapping:

Stream #0:1 -> #0:0 (pcm_s16le -> pcm_s16le)

Press [q] to stop, ? for help
Input stream #0:1 frame changed from rate:48000 fmt:s16 ch:2 chl:0x0 to rate:480
00 fmt:s16 ch:2 chl:0x3
size= 6kB time=00:00:00.03 bitrate=1547.0kbits/s
video:0kB audio:6kB global headers:0kB muxing overhead 0.717853%

Version 0, edited 4 years ago by tom_bogle (next)

comment:3 Changed 4 years ago by cehoyos

How does the output look for ffmpeg -i TruncatedPCMAudio.avi out.mp2 (or mp3)?
If I understand your original report correctly, the output is longer than 0,03 seconds.

comment:4 Changed 4 years ago by cehoyos

  • Keywords avi added
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

(I originally failed to reproduce the problem, sorry.)

out2.wav is significantly longer than out.wav

$ ffmpeg -i TruncatedPCMAudio_smallsample.avi out.wav
ffmpeg version N-47510-g0f65d56 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  6 2012 12:30:03 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 11.102 / 52. 11.102
  libavcodec     54. 79.100 / 54. 79.100
  libavformat    54. 46.100 / 54. 46.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 24.100 /  3. 24.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, avi, from 'TruncatedPCMAudio_smallsample.avi':
  Duration: 00:03:52.47, start: 0.000000, bitrate: 88 kb/s
    Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Output #0, wav, to 'out.wav':
  Metadata:
    ISFT            : Lavf54.46.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (pcm_s16le -> pcm_s16le)
Press [q] to stop, [?] for help
size=       6kB time=00:00:00.03 bitrate=1555.2kbits/s
video:0kB audio:6kB subtitle:0 global headers:0kB muxing overhead 1.248439%
$ ffmpeg -i TruncatedPCMAudio_smallsample.avi -qscale 2 out.avi
ffmpeg version N-47510-g0f65d56 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  6 2012 12:30:03 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 11.102 / 52. 11.102
  libavcodec     54. 79.100 / 54. 79.100
  libavformat    54. 46.100 / 54. 46.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 24.100 /  3. 24.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, avi, from 'TruncatedPCMAudio_smallsample.avi':
  Duration: 00:03:52.47, start: 0.000000, bitrate: 88 kb/s
    Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 8:9 DAR 4:3], 28771 kb/s, 29.97 tbr, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    ISFT            : Lavf54.46.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo -> mpeg4)
  Stream #0:1 -> #0:1 (pcm_s16le -> ac3)
Press [q] to stop, [?] for help
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540]     Last message repeated 2 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
AC EOB marker is absent pos=67
AC EOB marker is absent pos=64messsage repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=67
    Last message repeated 4 times
    Last message repeated 4 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=87
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=64
AC EOB marker is absent pos=66mes
[dvvideo @ 0x337b540] AC EOB marker is absent pos=77
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
AC EOB marker is absent pos=67
    Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=78
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] AC EOB marker is absent pos=75
[dvvideo @ 0x337b540] AC EOB marker is absent pos=71
    Last message repeated 6 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
AC EOB marker is absent pos=64mes
    Last message repeated 3 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=74
[dvvideo @ 0x337b540] AC EOB marker is absent pos=67
[dvvideo @ 0x337b540] AC EOB marker is absent pos=84
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
    Last message repeated 2 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
    Last message repeated 1 timesssage repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
AC EOB marker is absent pos=64mes
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540]     Last message repeated 1 times
    Last message repeated 1 times
AC EOB marker is absent pos=65
    Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
AC EOB marker is absent pos=71
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=69
    Last message repeated 2 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=68
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
    Last message repeated 2 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
    Last message repeated 2 times
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=72
[dvvideo @ 0x337b540] AC EOB marker is absent pos=67
AC EOB marker is absent pos=71
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
    Last message repeated 1 times
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=65
AC EOB marker is absent pos=75
[dvvideo @ 0x337b540] AC EOB marker is absent pos=67
[dvvideo @ 0x337b540] AC EOB marker is absent pos=68
    Last message repeated 1 timesssage repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=78
    Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=79
AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=74
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
AC EOB marker is absent pos=66mes
    Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=65
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=73
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540]     Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] [dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
[dvvideo @ 0x337b540] AC EOB marker is absent pos=66
AC EOB marker is absent pos=65
AC EOB marker is absent pos=79
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
[dvvideo @ 0x337b540] AC EOB marker is absent pos=79
    Last message repeated 1 times
[dvvideo @ 0x337b540] AC EOB marker is absent pos=82
[dvvideo @ 0x337b540] AC EOB marker is absent pos=71
[dvvideo @ 0x337b540] AC EOB marker is absent pos=64
Truncating packet of size 120000 to 88569
frame=   20 fps=0.0 q=2.0 Lsize=    1333kB time=00:00:00.67 bitrate=16253.5kbits/s
video:1307kB audio:16kB subtitle:0 global headers:0kB muxing overhead 0.810966%
$ ffmpeg -i out.avi out2.wav
ffmpeg version N-47510-g0f65d56 Copyright (c) 2000-2012 the FFmpeg developers
  built on Dec  6 2012 12:30:03 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 11.102 / 52. 11.102
  libavcodec     54. 79.100 / 54. 79.100
  libavformat    54. 46.100 / 54. 46.100
  libavdevice    54.  3.102 / 54.  3.102
  libavfilter     3. 24.100 /  3. 24.100
  libswscale      2.  1.103 /  2.  1.103
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, avi, from 'out.avi':
  Metadata:
    encoder         : Lavf54.46.100
  Duration: 00:00:00.67, start: 0.000000, bitrate: 16253 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 720x480 [SAR 8:9 DAR 4:3], 29.97 fps, 29.97 tbr, 29.97 tbn, 30k tbc
    Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, s16, 192 kb/s
Output #0, wav, to 'out2.wav':
  Metadata:
    ISFT            : Lavf54.46.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (ac3 -> pcm_s16le)
Press [q] to stop, [?] for help
size=     126kB time=00:00:00.67 bitrate=1537.0kbits/s
video:0kB audio:126kB subtitle:0 global headers:0kB muxing overhead 0.062004%

comment:5 Changed 3 years ago by cehoyos

  • Keywords dvvideo added

comment:6 Changed 3 years ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
  • Resolution set to fixed
  • Status changed from open to closed

This used to be a regression since 574dcb5b / 13f6917c, fixed in c8f0b20b by Luca Barbato.

Note: See TracTickets for help on using tickets.