[vlc-devel] MPEG Duration/Playback Ending?
Developer
developer at noknok.net
Thu Nov 5 00:13:55 CET 2009
I have a question to which I am hoping I can be enlightened on.
1. During an acquisition via HTTP (eg: http://www.xyz.com/movie.mpg),
VLC inititially requests the file from 0-, then does a secondary request
200,000 bytes less then size. I am assuming this is so it can determine
the estimated time length. What specifically is it looking for in that
second request? It doesnt seem to be a TIMESTAMP_PACKET, so I am
assuming a VIDEO packet, or an AUDIO packet to which to read the
timestamp from?
I ask because am attempting to build a pseudo-live streaming server for
MPEG2 (VOB), using a live source. In the initial request I pass back in
the HTML a length of "x", which is actually 1/2 of 1% bigger than the
what the resulting file will be. I need to also now send back in that
2nd request request appropriate frames with timestamps matching my
estimated length.
This in fact works - somewhat - in that, on a a live stream, when I get
that 2nd request, I am serving the last 10,000 bytes of a previous 5
minutes long MPEG video. I add 0xFF to the rest of it matching the
request i got (so if VLC asked for the last 200,000 bytes, i send my
10,000 + 190,000 0xFF) and VLC accepts this, and in the playback window
i see it has estimated the video at 5 minutes (as that is what the
length is of the video i clipped the ending from). I of course need to
dynamically be able to set the timestamps or whatever in that chunk to
whatever my real estimated time is going to be. So needing to know what
it is VLC is looking for.
2nd issue. Event though the above works, when I fast forward say 2/3
(3.5 minutes) into the slider scale, and say only having 1/3 (90
seconds) the file available, when I get the HTTP Request moving to that
position, I just serve data from the point at which I am in the live
feed. VLC accepts this, adjusts the CURRENT POSITION TIMESTAMP NUMBER
in the lower right corner correct, so if i really served data from 90
seconds on, it displays that appropriately, BUT (1) the slider bar does
not correctly adjust to 90 seconds, it stays at where I moved it to.
This is a problem because it seems when the BAR reaches the end (not the
stream), VLC stops playing, even though I am still streaming the data to it.
I know this is probably (not even a little) but a lot off kilter, but
being able to play LIVE (meaning truly live, not recorded and streams,
but live video streaming) streams, with fast forward/rewind is real
important, and using a web based solution (http progressive) for this
solves a lot of interop. issues, and removes the need for FLASH RTMP, or
other realtime solutions.
Any feedback would be really appreciated
Shawn
More information about the vlc-devel
mailing list