Incorrect duration after editing with avidemux
#1
I'm posting this in the forums to see if anyone else has run across this behavior before possibly adding to the bug tracker.

The issue is that, after cutting a file with the program Avidemux, XBMC reports the duration to be ridiculously long (60hrs, 72hrs, etc). I initially figured this to be an issue with Avidemux, but Windows media player and VLC both report the duration correctly. This is not a game-breaking bug, however - the video plays fine and finishes when it should - it only displays the incorrect duration.

I've made a small file that can be used for testing (6MB). It's only the intro to Adventure Time, but I've named it so that XBMC will recognize it as episode 21 of season 5. Here it is:

https://dl.dropboxusercontent.com/u/1964...0intro.avi

This is a screen capture of what it looks like (In this case it reports the duration as 2hrs 12 minutes, when it is actually 24 seconds):

https://dl.dropboxusercontent.com/u/196458/duration.jpg

Here is the same file in Windows Media Player and VLC (which both correctly identify it as 24 seconds long):

https://dl.dropboxusercontent.com/u/1964...on_wmp.jpg
https://dl.dropboxusercontent.com/u/1964...on_vlc.jpg

I'm sure the easy thing is to blame the software I used to cut the file, but I feel that is irrelevant if other programs have no issue correctly identifying the duration. Please let me know if this is already in the bug tracker, or if there is an easy fix. Thanks!
Reply
#2
I am not sure exactly what the problem is - it shows wrong for me too.

Can be fixed though with

Code:
ffmpeg -i Adventure.Time.S05E21\ intro.avi -vcodec copy -acodec copy Adventure.Time.S05E21\ intro-fixed.avi

This copies the video and audio streams (no re-encoding) and remuxes them into a new container. It them shows correct duration in XBMC. It took less than a second on that small sample (0.058s actually).
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
I tried using ffmpeg to fix that, though I'd never used it before and downloaded the latest from here: http://ffmpeg.zeranoe.com/builds/

I used the same command you did, but the video is very slow in the beginning and gets way out of sync from the audio (when testing it in VLC, it couldn't play the audio at all for it). Perhaps the Windows version of ffmpeg sucks. But XBMC did recognize that the video was 24 seconds while playing. In the menus it was still having issues, though - does yours do this?

https://dl.dropboxusercontent.com/u/1964...licate.jpg

Both files still read as 2hrs, 13 minutes in the menus.
Reply
#4
The duration in the menu is of everything in that directory.

It seems to play correctly, but it is pretty hard to tell if sync is right on a cartoon.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
Oh right, I forgot that it summed up all the durations (which doesn't seem very useful unless you're doing a marathon).

Yours is probably fine - you would have noticed it, since it was very obviously screwed up after the re-encoding. Did you do that on Windows, or Linux?

Regardless, it seems that WMP and VLC read the duration in a different way, or have a failsafe that XBMC doesn't employ.
Reply
#6
The total is for gloating purposes I think. I used linux.
Reply
#7
My experience is sometimes Avidemux can barf (I use the 32 bit nightly but also can happen on the release ver). It depends on the encodings and container used. For example works good for me on AVC/AAC in mp4 or mkv, mpeg-2 not so much. I haven't had any trouble running ffmpeg on windows. That's what's under the hood in XBMC dvdplayer.

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Incorrect duration after editing with avidemux0