#1624 closed defect (fixed)
AC-3 decode errors with -audiofile
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | demuxer |
Version: | HEAD | Severity: | normal |
Keywords: | Cc: | reimar | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
I have a video file and raw AC-3 audio file. When I play them using ffac3 (the default now) and -audiofile:
mplayer video.mov -ac ffac3 -audiofile bits0001.a52 -rawaudio format=0x2000 -audio-demuxer rawaudio
I get lots of errors like:
MPlayer SVN-r30311-4.2.1 (C) 2000-2009 MPlayer Team
Playing video.mov.
libavformat file format detected.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x102052e00]moov atom not found
LAVF_header: av_open_input_stream() failed
ISO: File Type Major Brand: Original QuickTime
Quicktime/MOV file format detected.
[mov] Video stream found, -vid 0
VIDEO: [avc1] 100x75 24bpp 0.200 fps 0.0 kbps ( 0.0 kbyte/s)
rawaudio file format detected.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Forced audio codec: ffac3
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [coreaudio] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x1008bc820]BICUBIC scaler, from yuv420p to yuyv422 using MMX2
VO: [corevideo] 100x75 => 100x75 Packed YUY2
[ac3 @ 0x1008b31a0]incomplete frame
[ac3 @ 0x1008b31a0]invalid frame size
[ac3 @ 0x1008b31a0]frame CRC mismatch
[ac3 @ 0x1008b31a0]frame CRC mismatch
[ac3 @ 0x1008b31a0]frame CRC mismatch
[ac3 @ 0x1008b31a0]frame CRC mismatch
[ac3 @ 0x1008b31a0]frame CRC mismatch
[...]
If I build with --enable-liba52-internal and use -ac a52, it plays fine.
But I'm not sure it's a libavcodec issue because ffac3 decodes the audio fine when not using -audiofile, i.e. this does not get errors even when using ffac3:
mplayer bits0001.a52 -ac ffac3 -rawaudio format=0x2000 -audio-demuxer rawaudio
So it seems like some interaction with using ffac3 with -audiofile
Sample files video.mov and bits0001.a52 uploaded to incoming/audiofile-ac3
Change History (4)
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
You are right that removing the rawaudio options is better. I found one other problem when they are specified, mplayer misdetects the samplerate as 44100 instead of 48000.
Removing "-rawaudio format=0x2000 -audio-demuxer rawaudio" fixes this and it detects 48000.
$ mplayer video.mov -ac ffac3 -audiofile bits0001.a52 -rawaudio format=0x2000 -audio-demuxer rawaudio
[...]
Forced audio codec: ffac3
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 44100 Hz, 2 ch, s16le, 1411.2 kbit/100.00% (ratio: 176400->176400)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
$ mplayer video.mov -ac ffac3 -audiofile bits0001.a52
[...]
Forced audio codec: ffac3
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
Forcing a52 detects 48000 even with the rawaudio options.
$ mplayer video.mov -ac a52 -audiofile bits0001.a52 -rawaudio format=0x2000 -audio-demuxer rawaudio
[...]
Forced audio codec: a52
Opening audio decoder: [liba52] AC3 decoding with liba52
No accelerated IMDCT transform found
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
comment:3 by , 15 years ago
Does it also play wrong when the sample rate is misdetected?
I'd think that just the output will be wrong, due to MPlayer no analyzing the AC3 data beforehand with rawaudio, so it just guesses a sample rate.
comment:4 by , 15 years ago
I think it is actually using the wrong samplerate to decode. If I transcode the file with mencoder, the audio track ends up being too short since it is using 48000 instead of 44100
Thanks for your report.
Fixed by SVN r30312
Note however that the far easier solution to this is just to remove all the rawaudio options, raw AC3 is auto-detected nowadays (if not, report it).