Dividing a Video into Frames and Sending Frames to Streams
Posted
by Amit Kumar
on Stack Overflow
See other posts from Stack Overflow
or by Amit Kumar
Published on 2010-04-01T04:53:59Z
Indexed on
2010/04/01
5:03 UTC
Read the original article
Hit count: 440
java
|video-streaming
I have to implement a "demux" that divides up a video stream and sends each frame to one of multiple output streams in a round-robin fashion. I am trying to implement the demux as follows. The video stream contains one frame after another and is implemented via a java InputStream
. Each frame has a frame header followed by the image data. The demux needs to read the frame header to know the size of the image data. The image data can then be redirected from the input video stream to one of the output streams (java OutputStream
).
My problem is about how to implement this redirection. That is, connect the InputStream
to the OutputStream
to send N
bytes (here N
is the size of the image data), and then disconnect and connect to another OutputStream
. I have seen the interface of PipedInputStream
etc but they do not seem to implement the disconnection.
© Stack Overflow or respective owner