Page 1 of 1

VB.net + ActiveX problem: Length property NULL

Posted: 18 Dec 2006 00:54
by hueen
Hey,

I am using the VLC activeX plugin in a vb.net project and it basically works just fine, except for: The Length property always returns 0 (NULL, zero). In contrast, Position works fine.

How can I get it to work?

I am trying to capture the current video frame as an image. I wanna use either ffmpeg or vlc command line for that. Neither of both can use percentage positions, which is the output of the activex Position property. If I now had the Length, I could calculate my position in (milli)seconds.

Maybe someone has another tip on how to achieve this?


My code that plays a video:

Code: Select all

Dim MRLstring As String = tab1_dirlistbox.Path + "\" + tab1_filelistbox.SelectedItem tab1_AxVLCPlugin.addTarget(MRLstring, Nothing, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, 0) tab1_AxVLCPlugin.play()
tab1_AxVLCPlugin.Position always returns the position in percent
tab1_AxVLCPlugin.Length always returns NULL


Thanks alot for any help!

Posted: 18 Dec 2006 10:29
by Quovodis
this is probably due to the type of media you are using

Posted: 18 Dec 2006 19:33
by Tappen
Are you playing an Mpeg Transport Stream file (.ts or .tp) file? I'm afraid Vlc doesn't calculate the length for media types like this even when they're in file form.

Posted: 19 Dec 2006 17:08
by hueen
The files are mpg encoded with ffmpeg from vob files.

I just tested with vob files directly and it actually works. I will test some more with different file types at some point, but for now I only need to have vob files working anyway. Thanks for the tips.

Posted: 21 Dec 2006 00:22
by Tappen
Make sure they're mpeg PS (program stream) encapsulated, rather than mpeg TS (transport stream) encapsulate, if you want to see the Length in Vlc.

Posted: 21 Dec 2006 13:27
by hueen
Make sure they're mpeg PS (program stream) encapsulated, rather than mpeg TS (transport stream) encapsulate, if you want to see the Length in Vlc.
Can a vob file ever be mpeg TS?

Posted: 21 Dec 2006 19:45
by Tappen
A vob file is a vob file. When you transcode (Save/Stream) from vob to mpeg you get to set the encapsulation, TS or PS or whatever. I was just asking which you'd picked.

If you want to do a really good clean job of combining multiple vob files into a single mpeg PS file use VideoRedo. I know it's $50 but it's the only non-free video app I use or recommend, it's that good.