PDA

View Full Version : writing a video switch


ozzzy
19th March 2006, 00:58
I'm about to write a daemon (server) that works as a switch for streams of video data (i have decided that it should be able to handle h.264 avc)

3 continuous streams from my tv card(s?) comes via 3 different udp streams to say ports 1001, 1002 & 1003) on my server

and then i have a client that has a prog (vlc for example)listening on a udp port say 1234..

i want to be able to choose which stream to send to the client

so: 1001 or 1002 or 1003 ----> client's 1234

and i want to make the daemon that handles this switching..

the problem is of course when switching, the simplest way would be to just cut in the middle of the stream wherever it may be.. the viewer would then experience some strangeness until the next complete I frame is transferred (at the second channel).. when i first thought of this method i was considering the mpeg-2 format..

but what caught my mind was when reading about h.264 avc, and that it may have many many references to I frames - i am worried that this may cause a problem , perhaps the receiver will wait 10s of seconds before anything interesting comes up on the screen.. could this be true ?

a better way of streaming would be of course to cache the latest received I frame from each channel
and on switch - send first the I frame and then the stream..

any ideas ?

BetaBoy
19th March 2006, 03:19
Well.... there are several similar switching solutions out there... the ones that come to mind are more at the codec level that pre buffers channels ahead + or - the user is going too. There is also other similar codec like switching products... see http://www.codecsys.com

I only wish I had digital broadcasts in H.264 (even if it is a TS stream) to test on.

akupenguin
19th March 2006, 07:54
but what caught my mind was when reading about h.264 avc, and that it may have many many references to I frames - i am worried that this may cause a problem , perhaps the receiver will wait 10s of seconds before anything interesting comes up on the screen.. could this be true?
H.264 is no different than any other codec in this regard. When you compress the video you get to choose how often to insert an I-frame, and that controls how long you'll have to wait for a resync.