Opened 18 years ago
Closed 18 years ago
#783 closed defect (fixed)
MP4 demuxing problems with both Quicktime/MOV and lavf
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | demuxer |
Version: | HEAD | Severity: | major |
Keywords: | Cc: | reimar, compn, ajaxas@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
System: OpenSUSE 10.2
Kernel: 2.6.21-rc3 (vanilla)
libc: libc-2.5
gcc: 4.1.2 (final)
ld: 2.17.50.0.5 20060927 (SUSE Linux)
as: 2.17.50.0.5 20060927 (SUSE Linux)
CPU: Athlon XP (Barton) 2500+
Video card: NVidia GeForce FX 5200 128MB
Video driver: NVIDIA-Linux-x86-1.0-9631
Sound card: Creative SB128 (ens1371) with the kernel ALSA driver
There are problems with both mp4 container demuxers that are present in Mplayer.
1) Quicktime/MOV demuxer identifies some MP4 files incorrectly.
At least, ID_LENGTH is being detected wrong. This results in incorrect OSD time as described in bug #30 and inability to search through the file past some point (not necessarily the time that the wrong OSD time shows.) Searching past the point results in returning to the beginning of the file.
The problem can be solved by using -demuxer lavf option, here's the output:
Quicktime/MOV:
mplayer \[ToyBox\]Mamoru-kun_ni_Megami_no_Shukufuku_wo\!_02_\[D43860AD\].mp4 -identify
MPlayer dev-SVN-r22781-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2500+ (Family: 6, Model: 10, Stepping: 0)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
Cannot load bitmap font: arial
Playing [ToyBox]Mamoru-kun_ni_Megami_no_Shukufuku_wo!_02_[D43860AD].mp4.
Quicktime/MOV file format detected.
ID_VIDEO_ID=0
ID_AUDIO_ID=1
VIDEO: [avc1] 704x400 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=[ToyBox]Mamoru-kun_ni_Megami_no_Shukufuku_wo!_02_[D43860AD].mp4
ID_DEMUXER=mov
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=704
ID_VIDEO_HEIGHT=400
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=mp4a
ID_AUDIO_BITRATE=89688
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=156.58
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 48000 Hz, 2 ch, s16le, 89.7 kbit/5.84% (ratio: 11211->192000)
ID_AUDIO_BITRATE=89688
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
Starting playback...
VDec: vo config request - 704 x 400 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 704x400 => 704x400 Planar YV12
-demuxer lavf
mplayer \[ToyBox\]Mamoru-kun_ni_Megami_no_Shukufuku_wo\!_02_\[D43860AD\].mp4 -identify -demuxer lavf
MPlayer dev-SVN-r22781-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2500+ (Family: 6, Model: 10, Stepping: 0)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
Cannot load bitmap font: arial
Playing [ToyBox]Mamoru-kun_ni_Megami_no_Shukufuku_wo!_02_[D43860AD].mp4.
libavformat file format detected.
ID_VIDEO_ID=0
ID_AUDIO_ID=1
VIDEO: [avc1] 704x400 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=[ToyBox]Mamoru-kun_ni_Megami_no_Shukufuku_wo!_02_[D43860AD].mp4
ID_DEMUXER=lavf
ID_VIDEO_FORMAT=avc1
ID_VIDEO_BITRATE=0
ID_VIDEO_WIDTH=704
ID_VIDEO_HEIGHT=400
ID_VIDEO_FPS=23.976
ID_VIDEO_ASPECT=0.0000
ID_AUDIO_FORMAT=mp4a
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=1445.14
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
ID_VIDEO_CODEC=ffh264
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio) decoder)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=faad
Starting playback...
VDec: vo config request - 704 x 400 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 704x400 => 704x400 Planar YV12
Although it determines audio bitrate wrong, the playback is OK.
Strange, but both demuxers cannot identify video bitrate. This is also true for the files that Quicktime/MOV demuxer doesn't have any problems with.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2) Although -demuxer lavf solves the first problem, it cannot determine audio format correctly and fails playing sound except for AAC. Seems like it always finds FAAD (writes “Cannot find codec for audio format 0x6134706D” whichever audio format is present.) Tested with MP3 and Vorbis audio streams (although there shouldn't be any Vorbis streams in MP4, the Haali splitter in Windows works fine.)
The problem can be solved by explicitly telling mplayer which codec to use, f.e.: -demuxer lavf -ac +mp3
Here's the output:
-demuxer lavf
mplayer \[Ayako\]_Shuffle\!_Memories_02_\(H264\)_\[ED862C84\].mp4 -demuxer lavf
MPlayer dev-SVN-r22781-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2500+ (Family: 6, Model: 10, Stepping: 0)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
Cannot load bitmap font: arial
Playing [Ayako]_Shuffle!_Memories_02_(H264)_[ED862C84].mp4.
libavformat file format detected.
VIDEO: [avc1] 704x396 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: Failed to initialize the decoder!
ADecoder init failed :(
ADecoder init failed :(
Cannot find codec for audio format 0x6134706D.
Read DOCS/HTML/en/codecs.html!
Audio: no sound
Starting playback...
VDec: vo config request - 704 x 396 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 704x396 => 704x396 Planar YV12
-demuxer lavf -ac +mp3
mplayer \[Ayako\]_Shuffle\!_Memories_02_\(H264\)_\[ED862C84\].mp4 -demuxer lavf -ac +mp3
MPlayer dev-SVN-r22781-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2500+ (Family: 6, Model: 10, Stepping: 0)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
Cannot load bitmap font: arial
Playing [Ayako]_Shuffle!_Memories_02_(H264)_[ED862C84].mp4.
libavformat file format detected.
VIDEO: [avc1] 704x396 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Forced audio codec: +mp3
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 704 x 396 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 704x396 => 704x396 Planar YV12
Both of these problems should be considered as bugs as they aren't present when using MPC+ffdshow or bsplay in Windows.
Original discussion held in mplayer-users list:
http://lists.mplayerhq.hu/pipermail/mplayer-users/2007-March/065903.html
Change History (6)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
i reported this to the devs , the thread gets large...
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-March/050339.html
comment:3 by , 18 years ago
(In reply to comment #2)
I am as happy as I could be on Friday's evening... Hope Reimar or anyone will merge this into HEAD. Thank you!
But this only answers my second question. What about Quicktime/MOV/MP4 demuxer (i.e. mplayer itself?) problem with mp4?
Okay, I'm using mc and sure can force -demuxer lavf for all MP4 files (and only them), but what if someone uses GUI version? Or else, what if someone wants subtitles in MP4?
comment:4 by , 18 years ago
Cc: | added |
---|
Oh, would please anybody look into it? The patch was proposed by Reimer half a month ago (http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-March/050377.html), it does solve the second problem and it doesn't seem to be breaking anything, but it's still not committed to the HEAD!
I don't mind that much about the fact that both demuxers can't determine bitrate of video streams in MP4 files, but if we are going to (eventually) release the 1.0 version, wouldn't it be nice to have mplayer working properly with MP4 container?
comment:5 by , 18 years ago
2) Although -demuxer lavf solves the first problem, it cannot determine audio
format correctly and fails playing sound except for AAC.
i think this problem was fixed in svn, please check.
comment:6 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In reply to comment #5)
2) Although -demuxer lavf solves the first problem, it cannot determine audio
format correctly and fails playing sound except for AAC.
i think this problem was fixed in svn, please check.
Well yeah, Reimar issued another patch and applied it. I forgot to close the bug 'cause I found another problem with lavf and started testing.
So, as we all hate our poor native demuxer, and lavf part is fixed now, let's close this one.
(In reply to comment #0)
As there's a limit of 1024KB on attachment, I'v uploaded a MP4 file named "MP4_demuxing_errors.mp4" to ftp://upload.mplayerhq.hu/MPlayer/incoming/.
The file displays both of the problems.