[pvrusb2] streaming through windows share

Rod Smith rodsmith at rodsbooks.com
Tue Oct 9 13:08:41 CDT 2007


On Tuesday 09 October 2007 13:07:45 Matt Nyerges wrote:
> > > Hi,
> > >
> > > Is it possible, or can anyone think of anyway /dev/video0 can be
> > > streamed through windows share?
> >
> > That's an interesting idea.
> >
> > However that's really a question for Samba (the entity I presume you are
> > using to share the "files" with Windows).  I suspect that this would not
> > be likely to work
>
> I don't know how much disk space you have on your computer, but you might
> try sharing a directory using Samba (like /home/username/videos), and then
> run a "cat /dev/video0 > /home/username/videos/livetv.mpg".
>
> Then on your Windows box try to access livetv.mpg on that share.  This way
> you could also seek in your stream (pause, rewind, etc.).
>
> The only drawback I see is disk space usage and that while cat'ing the
> video the file livetv.mpg may be locked and inaccessible from the Windows
> share.

If this works, it could be automated using Samba's "preexec" and "postexec" 
options. Use the former to specify a command or script to run when a user 
connects to a share (such as the cat command Matt suggests), and the latter 
to specify a command or script to run when a user disconnects from a share (a 
command to remove the temporary MPEG file, say). The trick is that 
disconnection might not occur in a timely fashion, so the temporary file 
could grow to ridiculous size even when it's not being viewed. It's possible 
that the "deadtime" parameter could help work around this problem. Consult 
the Samba man pages and/or any good book on Samba for details about how these 
parameters work. If you find that this approach works, I recommend setting 
aside a separate partition to hold the tempoary MPEG file, sized to the 
maximum reasonable size you'd create, so that if something goes wrong and the 
postexec script never executes, it won't fill all your disk space.

-- 
Rod Smith, rodsmith at rodsbooks.com
http://www.rodsbooks.com
Author of books on Linux, FreeBSD, and networking


More information about the pvrusb2 mailing list