Opened 12 years ago

Closed 11 years ago

#870 closed defect (fixed)

-demuxer lavf doesn't correct wrong PTS for MP4 files

Reported by: ajaxas@… Owned by: reimar
Priority: normal Component: demuxer
Version: HEAD Severity: major
Keywords: Cc: compn, ajaxas@…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

System: Ubuntu 7.04
Kernel: 2.6.22.1 (vanilla)
libc: libc-2.5
gcc: 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
ld: 2.17.50 20070103 Ubuntu
as: 2.17.50 20070103 Ubuntu

CPU: AMD Athlon 64 X2 4400+ (Brisbane)
Video card: NVidia GF-7300GT 256MB
Video driver: NVIDIA-Linux-x86-100.14.09-pkg1
Sound card: on-board ALC883 with ALSA driver


For certain MP4 files (f.e. 'Nodame Cantabile', release by Froth-Bite) mplayer's original MOV/MP4 demuxer tells that PTS doesn't correspond to the length and plays the file normally, while -demuxer lavf doesn't report anything and fails to sync audio and video streams: at some point video stream starts running faster than it should be, while audio stream seems to be played normally.

This can be fixed with -correct-pts option.

Though this is indeed a question of buggy files, I think lavf should be able to demux such file not worse than original demuxer.

Here are examples, note the differences in ID_AUDIO_BITRATE, ID_AUDIO_FORMAT, ID_LENGTH:

1) mplayer original MOV/MP4 demuxer:

mplayer \[Froth-Bite\]Nodame_Cantabile_-_11\[1A9819D3\].mp4 -identify
MPlayer dev-SVN-r23855-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ (Family: 15, Model: 107, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
Cannot load bitmap font: arial

Playing [Froth-Bite]Nodame_Cantabile_-_11[1A9819D3].mp4.
Quicktime/MOV file format detected.
Warning! pts=1354770083 length=1354853500
ID_VIDEO_ID=0
[mov] Video stream found, -vid 0
ID_AUDIO_ID=1
[mov] Audio stream found, -aid 1
VIDEO: [avc1] 704x400 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=[Froth-Bite]Nodame_Cantabile_-_11[1A9819D3].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=129024
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=1354.85
==========================================================================
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, 129.0 kbit/8.40% (ratio: 16128->192000)
ID_AUDIO_BITRATE=129024
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

2) lavf demuxer:

mplayer \[Froth-Bite\]Nodame_Cantabile_-_11\[1A9819D3\].mp4 -identify -demuxer lavf
MPlayer dev-SVN-r23855-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4400+ (Family: 15, Model: 107, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
Cannot load bitmap font: arial

Playing [Froth-Bite]Nodame_Cantabile_-_11[1A9819D3].mp4.
libavformat file format detected.
ID_VIDEO_ID=0
[lavf] Video stream found, -vid 0
ID_AUDIO_ID=1
[lavf] Audio stream found, -aid 1
VIDEO: [avc1] 704x400 24bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
ID_FILENAME=[Froth-Bite]Nodame_Cantabile_-_11[1A9819D3].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=28781
ID_AUDIO_BITRATE=0
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
ID_LENGTH=1354.82
==========================================================================
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 YV122

Change History (5)

comment:1 Changed 12 years ago by ajaxas@…

Or perhaps lavf doesn't correct wrong ID_LENGTH.

comment:2 Changed 12 years ago by ajaxas@…

Oooookay. Compn had requested a sample, so I've uploaded "bug_870_sample.mp4" to the usual place.
The thing starts at 00:01:25.

comment:3 Changed 12 years ago by compn

plays fine with
mplayer -demuxer lavf bug_870_sample.mp4 -mc 10

comment:4 Changed 12 years ago by ajaxas@…

(In reply to comment #3)

plays fine with
mplayer -demuxer lavf bug_870_sample.mp4 -mc 10

Yes, but that wasn't my point. I just believe lavf should be able to handle this automatically, as does the original demuxer.

Oh well, gonna report this thing to the new ffmpeg bugtracker you've told me about. :)

comment:5 Changed 11 years ago by ajaxas@…

  • Resolution set to fixed
  • Status changed from new to closed

Since lavf demuxer is now default for *.MP4 files, and correct-pts is enabled by default as well, this thing is obsolete.

Thank you, Reimar!

Note: See TracTickets for help on using tickets.