[streaming] Re: Playing stream at twice normal speed, forward / backward?
Jean-Paul Saman
jpsaman at wxs.nl
Sun Apr 27 14:02:48 CEST 2003
John,
Look at these discussions for more information about forward/backward
streaming:
http://www.via.ecp.fr/via/ml/vls-devel/200208/msg00000.html
and this one:
http://www.via.ecp.fr/via/ml/vls-devel/200210/msg00023.html
John Michael Zorko wrote:
>
> Nitrox,
>
>> Good idea !
>
>
> Cool -- I already put together a very basic VLC-based way of doing this
> for our project at work, but while it works well enough for MP3 streams,
> it doesn't work as well for MPEG2 a/v streams. This is due to the VLC
> architecture being similar to that of VLS from the perspective that
> neither has a lot of knowledge about the innards of what they're
> streaming i.e. VLC's input_Seek() doesn't have an INPUT_SEEK_IFRAME,
> only INPUT_SEEK_BYTES and INPUT_SEEK_SECONDS. While my approach is good
> enough for now, frame-level seeking is needed for the next milestone.
Not nescessarily! You just need to find the right packet, eg an I-Frame.
Then you know that the next packets are part of that I frame, untill
another type of packet (for the same PID) crosses your path. Depending
on what you want to stream I-Frames only or GOPs? A decission can be
made to put packets for a certain PID in the buffer (SyncFIFO in vls terms).
>
I have an implementation for VLS ready, but not submitted to the CVS
yet. It works well for MPEG2 streams. I'm going to submit that in the
next few weeks after some more testing.
>> I was thinking about changing the streaming process of VLS:
>>
>> Current architecture:
>>
>> READER -> CONVERTER -> STREAMER
>>
>> Converters can be ps2ts ts2ts and raw2ts.
>> I think we should make a difference between:
>> - system layer converters
>> - low level converters
>>
Good idea !
>> The low level converters would be:
>> - raw -> mpeg1 (using ffmpeg)
>> - raw -> mpeg4 (using ffmpeg)
>> - mpeg2 -> mpeg2
>> - mpeg2 -> mpeg4 (using ffmpeg)
>>
>> A converter would be a system layer converter and a low level converter:
>>
>> system decoder -> low-level converter -> system encoder
>>
>> This would enable VLS to do live transcoding. In those converters, VLS
>> would be able to decode PES, so you would have the possibility to read
>> only I-frames for seeking.
>>
>> Unfortunately, I don't have much time currently and did not begin
>> anything like this, so I can't tell you when this new architecture
>> would be ready.
>>
>> Do you have any remark about this architecture ?
>
>
How does this enable forward/backward playing ?
> I've yet to have a good think about it, but it seems cool. So the
> low-level converter would interface to ffmpeg, but it would also expose
> as part of it's interface a method to expose a requested MPEG structure
> i.e. I-frame, MP3 frame, GOP, etc.? Would it call a member of some
> class we derive from to determine if this packet should be forwarded to
> the decoder or not?
>
You need another class in between that can leverage the interface (
GetPrevPacket() and GetNextPacket() ) you suggest, so it can be
leveraged from any CONVERTOR. Like this:
READER -> CONVERTER -> TRICKPLAY -> SyncFIFO -> STREAMER
* SyncFIFO is the buffer between reading thread and streaming thread in VLS.
The TrickPlay class needs a state machine with which state transistions
are possible between play, forward, backward, stop, pause, resume, etc.
Further more iso the CONVERTOR being in charge of the thread it needs to
be the TRICKPLAY class that controls the streaming thread now. It will
have to implement methods that can be called from the manager to trigger
the state transisitions.
> I've been in VLC land recently, I need to reaquaint myself with the VLS
> source. I would very much like to help with this project, though. Not
> only would it be a good thing to use for our project, i'm a streaming
> media nut anyway :-)
>
Me too ;-) And nuts :-)
Grtz,
Jean-Paul Saman.
--
This is the streaming mailing-list, see http://www.videolan.org/streaming/
To unsubscribe, please read http://www.videolan.org/support/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the streaming
mailing list