Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#5245 closed Bugs (Fixed)

[DVDPlayer] A/V desync problem with several MPEG4/DivX/XviD movies

Reported by: arnova Owned by: elupus
Priority: 4 - Normal Milestone: 9.11 "Camelot"
Component: Video playback (inc. audio in video and codecs) Version: GIT
Severity: Normal Keywords: dvdplayer
Cc: gamester17, spiff, elupus, areascout Blocked By:
Blocking: Platform: All
Revision:

Description (last modified by arnova)

Recently I've started using DVDPlayer as the default player for all my video stuff. Now I've noticed that with several DivX/XviD .avi files the A/V is out of sync. When I test the exact same files with MPlayer (or any other video player on my PC), they work fine. The problem occurs on Xbox and Linux, so I assume it happens on all platforms. I do notice a lot of these errors in my logfile (Although I also see these with movies that don't have A/V sync problems):

CDVDPlayerAudio:: Discontinuty - was:303836.891439, should be:268254.532284, error:-35582.359155

The issue is quite annoying and happens with approx. every 1 out of 15 movies. I've attached my debug log. If you want me to provide additional stuff or want me to do additional testing, let me know.

Attachments (1)

xbmc-26oct2008.log (65.1 KB) - added by arnova 7 years ago.

Download all attachments as: .zip

Change History (35)

Changed 7 years ago by arnova

comment:1 Changed 7 years ago by elupus

Need sample

comment:2 Changed 7 years ago by arnova

Here's a sample showing the problem: http://rocky.eld.leidenuniv.nl/lw-sample.avi

comment:3 Changed 7 years ago by arnova

Hopefully to make debugging easier, here's an additional sample: http://rocky.eld.leidenuniv.nl/ta-sample.avi

comment:4 Changed 7 years ago by arnova

  • Milestone set to 8.10

comment:5 Changed 7 years ago by arnova

  • Component changed from Other (un-categorized) to Video playback (inc. audio in video)
  • Keywords dvdplayer added

comment:6 Changed 7 years ago by sho

  • Milestone changed from 8.10 to 9.04

comment:7 Changed 7 years ago by arnova

An additional comment on this issue. I noticed that it seems like the video is out of sync, not the audio. I conclude this because the subtitles seem to sync ok with the audio and thus not with the video.

@Elupus: Any update on this issue?

comment:8 Changed 7 years ago by arnova

I did some additional testing mainly by comparing DVDPlayer to MPlayer. It turns out to be the audio that's off, after all (not the video). On the "ta-sample.avi" it's even several 10's of seconds off.

comment:9 Changed 7 years ago by arnova

  • Cc spiff added

comment:10 Changed 6 years ago by Novin

I have lots of problems with audio or video being out of sync but only on XBMC on Linux. If I play the same material on XBMC on XBOX it's OK. I'm not sure which player I use, I just use the default on both platforms.

For example, Scrubs.2x15.His_Story.DVDRip_XviD-FoV. This plays well on XBOX but not on Linux.

I'm using final Atlantis on both systems. Is some other bug? What can I do to further troubleshoot?

comment:11 Changed 6 years ago by sho

Does r16354 affect this?

comment:12 Changed 6 years ago by arnova

@Sho: Nope, r16354 does not affect this (just tested and it doesn't help one bit).

@Novin: The fact the it works on Xbox is because the default player on Xbox is mplayer. If you try to play the same content with DVDPlayer on Xbox (via Play Using) you will probably see the same issues.

comment:13 follow-up: Changed 6 years ago by Novin

@arnova: Ok, can I not use mplayer on XBMC/Linux?

comment:14 in reply to: ↑ 13 Changed 6 years ago by arnova

Replying to Novin:

@arnova: Ok, can I not use mplayer on XBMC/Linux?

Nope, only DVDPlayer is available on Linux/Win32/MacOSX to playback video.

comment:15 Changed 6 years ago by arnova

  • Cc elupus areascout added

comment:16 Changed 6 years ago by fr500

I was directed to post here from the forum

I get loads of these and any kind of video (mp4, avi so far) get out of sync and seem to be dropping frames.

01:19:52 T:3053569856 M: 16609280 DEBUG: CGUIInfoManager::SetCurrentMovie(http://192.168.1.200:49152/content/m..._id=0&ext=.avi) 01:19:52 T:2870918032 M: 16580608 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16580608 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16580608 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16580608 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16580608 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16449536 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 16220160 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:52 T:2870918032 M: 15818752 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:53 T:2870918032 M: 15671296 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:53 T:2870918032 M: 15532032 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:54 T:2870918032 M: 15056896 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:55 T:2870918032 M: 14561280 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:55 T:2870918032 M: 14561280 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 14168064 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13893632 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13893632 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13754368 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13639680 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13627392 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13512704 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:56 T:2870918032 M: 13512704 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:57 T:2870918032 M: 13512704 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:57 T:2870918032 M: 13398016 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:57 T:2870918032 M: 13373440 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected 01:19:57 T:2870918032 M: 13180928 INFO: ffmpeg: [NULL] Invalid and inefficient vfw-avi packed B frames detected

It's hardly useable as it is, I'm using ubuntu intrepid ibex on a Centrino Duo PC 2.1Ghz 1Gb RAM Nvidia Go5200.

Videos work fine in other players.

XBMC version is: SVN 16164

comment:17 Changed 6 years ago by arnova

I've created a bug report upstream as it is a problem in ffmpeg itself (verified with ffplay compiled from their SVN). As the problem seems to be in in the demuxer AND mplayer's demuxer always worked very well, maybe using mplayer's demuxer for dvdplayer is an option to fix this annoying issue?

comment:18 Changed 6 years ago by fr500

Further info my issue got fixed moving to software rendering so I guess my problem is in every way unrelated to this I don't have dropped frames anymore nor sync issues.

comment:19 Changed 6 years ago by arnova

comment:20 Changed 6 years ago by Bomb Bloke

I've got a file that does this too... (Eventually) found that it works fine in r11841 but stuffs up in every build after that.

http://www.soniconthenet.org/BBTemp/Ahnuld.flv

http://pastebin.com/f496fe99d - r11841 debug log

http://pastebin.com/f4362b9fa - r11843 debug log

(Debug logs look about the same to me, but the playback differences are easy to spot. I use X-Box builds.)

SVN log:

Revision: 11843 Author: elupus Date: 1:43:34 PM, Saturday, 1 March 2008 Message: merged: seek changes for dvdplayer from linuxport


Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodec.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemux.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxShoutcast.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxShoutcast.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDMessage.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDMessage.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDOverlayContainer.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayer.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayer.h Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayerAudio.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayerSubtitle.cpp Modified : /trunk/XBMC/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp

I also notice that this ticket is pretty much the same:

http://trac.xbmc.org/ticket/5231

comment:21 Changed 6 years ago by Bomb Bloke

Tried Arnova's files with those two builds...

This one seems to play ok with both:

http://rocky.eld.leidenuniv.nl/lw-sample.avi

This one de-syncs with both:

http://rocky.eld.leidenuniv.nl/ta-sample.avi

:S

comment:22 Changed 6 years ago by Bomb Bloke

Reckon I know what's wrong with the "ta" file. When I play it in DVDPlayer, the video de-syncs badly... Near the end you hear two men talking together, but the video cuts out before they actually appear on the screen. It reports a duration of 3:00 in the time bar.

Under MPlayer it syncs up perfectly, but the video STILL cuts out before the men appear... You don't see or hear them. Again, cuts out at three minutes.

Media Player Classic on my computer throws up a whole bunch of messages about how badly the file was packed, plays it synced for the first three minutes, at which point the video stops and from there you only hear the extended audio with the two blokes talking. Total duration of three minutes twenty.

So the audio stream is longer then the video stream inside the container file. DVDPlayer is ignoring the set frame rate and slowing things down so that the two play for the same amount of time.

Can't seem to make the LW file de-sync even with newer XBMC builds... :/

comment:23 Changed 6 years ago by arnova

Note that the LW sample is only off 1 second or so. So it's not that obvious as with the other sample....

comment:24 Changed 6 years ago by arnova

Could you also try my samples with the old r11843? I can't test it myself right now...

comment:25 Changed 6 years ago by Bomb Bloke

I've tried both samples with the two builds I mentioned before (r11841 & r11843). LW appears to play fine, though in fact r16762 (the last T3CH) does seem to play it ever so slightly better. Hard to tell there's an issue there unless you're looking for it; not even a quarter second off to my ears.

TA de-syncs badly on both those two old builds and the r16762 DVDPlayer.

So the changelog I posted only appears to apply to my sample file. :/

comment:26 Changed 6 years ago by arnova

  • Description modified (diff)
  • Summary changed from DVDPlayer A/V desync problem with several MPEG4/DivX/XviD movies to [DVDPlayer] A/V desync problem with several MPEG4/DivX/XviD movies

comment:27 Changed 6 years ago by elupus

The Ahnuld.flv sample is a different issue. It's timestamps keep jumping large amounts. I'm not sure why yet.

comment:28 Changed 6 years ago by Novin

I just tried with a fresh svn build (r16982).

Maybe 1/10 XviD movies plays with huge sync problems. Playing the same movies on my old XBOX XBMC (with 8.10 final), it works perfect.

Would it help with more samples?

comment:29 Changed 6 years ago by cdp2

I have attached another video clip, started as a XVID video w/ 160k mp3 audio. The video plays at a fraction of the speed it should while the audio plays fine. I hope this will help people figure this problem out.

Again, this plays just fine in mplayer.

The clip is on senduit.com which will expire in 1 week.

http://senduit.com/7974c1 [avi-sample-clip-cdp2.avi]

comment:30 Changed 6 years ago by theuni

confirmed. Out of sync with ffplay as well. In sync with mplayer.

comment:31 Changed 6 years ago by phi2039

  • Resolution set to Fixed in SVN
  • Status changed from new to closed

Fixed in r21057.

comment:32 Changed 6 years ago by phi2039

  • Resolution Fixed in SVN deleted
  • Status changed from closed to reopened

comment:33 Changed 6 years ago by phi2039

  • Resolution set to Fixed in SVN
  • Status changed from reopened to closed

Fixed in r21057.

comment:34 Changed 6 years ago by vdrfan

  • Milestone changed from Future / Pending to 9.10
Note: See TracTickets for help on using tickets.