Jim,

  This is what I've got for now

  .../freevo/video/plugins/vlc.py

  # -*- coding: iso-8859-1 -*-

# vlc.py - based on mplayer.py and xine.py

import os, re
import threading
import popen2
import mmpython

import config     # Configuration handler. reads config file.
import util       # Various utilities
import childapp   # Handle child applications
import rc         # The RemoteControl class.
import plugin

from event import *

class PluginInterface(plugin.Plugin):
    """
    VLC plugin for the video player, for RTSP streams
    """
    def __init__(self):
        plugin.Plugin.__init__(self)
        plugin.register(Vlc(), plugin.VIDEO_PLAYER, True)

class Vlc:
    """
    the main class to control vlc
    """
    def __init__(self):
        """
        init the vlc object
        """
        self.name       = 'vlc'
        self.app_mode   = 'video'
        self.app        = None
        self.plugins    = []
        self.cmd        = config.VLC_CMD

    def rate(self, item):
        """
        How good can this player play the file:
        2 = good
        1 = possible, but not good
        0 = unplayable
        """
        if item.url[:7] == ' udp:@:1234':
            return 2
        return 0
   
   
    def play(self, options, item):
        """
        play a videoitem with vlc
        """
        self.options = options
        self.item    = item
       
        mode         = item.mode
        url          = item.url

        self.item_info    = None
        self.item_length  = -1
        self.item.elapsed = 0       

        try:
            _debug_('Vlc.play(): url=%s' % url)
        except UnicodeError:
            _debug_('Vlc.play(): [non-ASCII data]')

#        command = self.cmd + '"%s"' % url
#        command = self.cmd + '"%s"' % url
        command = self.cmd + ' udp:@:1234 -f '
#" %s"'
# % url
#    :@:1234
#        command = self.cmd + ' --intf dummy -f --key-quit=esc "%s"' % url
        rc.app(self)

        self.app = childapp.ChildApp2(command)
        return None

    def stop(self):
        """
        Stop vlc
        """
        if not self.app:
            return
        self.app.kill(2)

        rc.app(None)
        self.app = None

    def eventhandler(self, event, menuw=None):
        """
        eventhandler for vlc control. If an event is not bound in this
        function it will be passed over to the items eventhandler
        """
        #print "VLC::EventHendler : " + str(event)
        if not self.app:
            #print "VLC::Eventhandler : NNE"
            return self.item.eventhandler(event)
       
        if event == STOP:
            self.stop()
            return self.item.eventhandler(event)

        if event in ( PLAY_END, USER_END ):
            self.stop()
            return self.item.eventhandler(event)

        return self.item.eventhandler(event)

  You'll find this is a modif of prior artwork

  http://sourceforge.net/project/showfiles.php?group_id=161461

  You'll find the readme valuable

  in local_conf.py

  plugin.activate('video.vlc')

   VLC_NICE = -30

  VLC_CMD  = CONF.vlc

  in etc/freevo/freevo.conf add

  vlc = /usr/bin/vlc

  The FXD file

  <?xml version="1.0" ?>
 <freevo>
   <container title="Internet TV" type="news">
  
     <movie title="Stream TV">
       <video>
         <url id="p1">
             udp:@:1234
           <player>vlc</player>
         </url>
       </video>
       <info>
         <description>Displays the playing stream.</description>
       </info>
     </movie>
   </container>
 </freevo>

  and in local_conf.py you need also to define the fxd file like this

VIDEO_ITEMS = [ ('action movies', '/media/cdrom'), ('webtv', '/mylocation/webtv.fxd' ) ]

  Basicly it wil start vlc fullscreen listening for udp streams on port 1234

  On the server I launch a command to stream from my ivtv card

vlc -I dummy --daemon pvr:/dev/video1:norm=pal:size=720x576:frequency=210250:bitrate=3000000:maxbitrate=4000000 --cr-average 1000 --sout udp:192.168.1.33 --ttl 12

  This all works in scripting for know

  Geert

  Quoting Jim Duda <[EMAIL PROTECTED]>:

Geert,

I too use VLC for streaming, however, I don't do this within freevo, I
do it outside of freevo, manually, using the telnet interface to VLC
running on the server.

my vlc startup script (/etc/init.d/rc.d/vlc) contains:

/usr/bin/vlc  --intf telnet --cr-average 1000 --vlm-conf
/usr/local/etc/videolan/vlc/vlc.cfg --rtsp-host 0.0.0.0:554 &

my vlc.cfg contains:
new livetv broadcast enabled
setup livetv input pvr:/dev/pvr350 --cr-average 1000
setup livetv output #standard{mux=ts,access=udp,url="224.0.0.1"}
control livetv stop

I then telnet to port 4212 of the server, login, and execute livetv start.

I would love to do this within freevo, via a plugin or similar.

Could you share your FXD file such that I can see what you are doing?

Thanks,

Jim

Geert Decorte wrote:
Folks I need some advice,

First I explain what I've got

- a freevo recording server running on CC 4.0 (no gui) works perfect.
This machine is also my home internet server (combining best of both
worlds) On this machine I have vlc installed and I'm alrady capable of
starting a live stream or a recorded stream from my PVR 500 in the CC
box. The client interface I have for the moment is a php webinterface
(mozilla only) which works in linux and windows. It's client independend.

Now I wanna implement live tv stream in a freevo client without TV card.
(Everything streamed from my CC server)

I'v created a fxd file capable of launching vlc on the client box in
stream listening mode, and streamed content gets actualy played.

(I'm using a modified vlc.py I grabbed from freevofreebox1.0.tgz)

Now I need to find a way to start up vlc with the desired parameters on
the server.

rsh comes to my mind to do this from the command line.

Is there any possibility to execute multiple commands from a fxd file?
like starting the stream remotly and then start vlc localy to listen.

Other aproaches?

Geert


------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


------------------------------------------------------------------------

_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users
e


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to