[vlc-devel] fixing broken avi files to get correct length of video

Mehmet Kaplan mehmetkpln at gmail.com
Wed Jun 9 14:34:27 CEST 2010

Hi all,
I'm developing a video player application using libvlc 1.1.0.
I have an avi video file with format MJPG.
libvlc_media_player_get_length function returns 1 second for the total
length of video. But original length is 19 seconds.
When I try to open video file with installed VLC Player (1.0.2) on my
computer, program pops up following dialog:

AVI Index
This AVI file is broken. Seeking will not work correctly.
Do you want to try to fix it?

This might take a long time.

When I choose to fix the video file, seeking is correct and video
length is shown 19 seconds on VLC Player.
But when i choose not to fix, length is 1 second such as in my program.
What is the problem in this avi video file, how VLC Player fixes this
file and how can I do the same thing VLC Player does?

Thanks in advance.

More information about the vlc-devel mailing list