Theora Streaming |
2004-06-09
|
Today I took some time to finish up the streamheader support for Vorbis and Theora. After some fiddling I was able to do live streaming of both using the GStreamer Data Protocol. (Since Vorbis and Theora are unpacketized formats, just sending them over TCP loses the framing information which makes it undecodable. So you need at least a basic packetizing protocol). So a server was reading an Ogg/Vorbis file from disk, marking the header buffers as streamheader and part of caps, and the client was able to pick in on the stream at any point.
Wim plugged a bunch of memleaks in the tcp code I wrote (I still can't get valgrind to work well on my gst-launch lines). With that, the server runs a bit more stably. Still not quite there though; checking just now shows that it's torn into 25% of memory use after 6 hours. But hunting leaks seems to be fun at the moment. Especially if most of them are in my code.
Using Python for the server code seems to work well for Johan but it makes it slightly harder to debug. We're left trying to figure out where the memory is leaking by running non-gst stuff from Python and vice versa.
Anyways, if Wim adds the buffer marking code to the ogg muxer tomorrow, then we can start doing Ogg/Theora streaming for real.
Now need to set up a frontend relay for the streams so we can post the link without hammering our download speeds.
Here's some harmless fun with the GStreamer tcp elements. Nothing special, just ten "tcpclientsrc protocol=gdp ! ffcolorspace ! ximagesink" gst-launch lines against one "v4lsrc device=/dev/video0 ! video/x-raw-yuv ! tcpserversink protocol=gdp" gst-launch line, and everything taking less than 15% CPU on my laptop.