knoppmyth.net Forum Index knoppmyth.net
The home of KnoppMyth.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New Title: mythstreamtv for Live TV
Goto page 1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    knoppmyth.net Forum Index -> MythTV
View previous topic :: View next topic  
Author Message
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Thu Jun 02, 2005 5:06 pm    Post subject: New Title: mythstreamtv for Live TV Reply with quote

I was at work today. ssh access and mythweb.

I finally got mythstream to work, just in time to watch the redsox on my desk...I went to mythweb and set the sox game to record, then I used mythstream to watch the recording.

Work reasons required me to reboot my PC, so I fire up mythstream again....I am at the beginning of the file. I couldn't seem to get the vlc http controls to work. I access the control page ate port 8002, but the controls didnt seem to work.

So I thought I could delete the recording. Then I could restart the recording and be back at real time. However I couldnt figure out how to delete the active recording via mythweb.

Any suggestions on either method of jumping ahead in almost-live tv and mythstream
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA


Last edited by khrusher on Fri Jun 03, 2005 1:14 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
wififun



Joined: 21 Jun 2004
Posts: 291
Location: Ontario, CA

PostPosted: Fri Jun 03, 2005 7:37 am    Post subject: Reply with quote

There may be a better way, but in the mean time, you could try this:
http://studwww.ugent.be/~aveys/mythwifi/
I have not tried it, but it is a web interface remote control. The methods used may help you figure out how to do what you are trying.

Another option I just thought of. If you used VLC to stream the nuv file, I think the command line has transport controls. SSH in start the stream via command line, then keep the ssh window open. You can then use the transport controls there.
Back to top
View user's profile Send private message
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Fri Jun 03, 2005 8:45 am    Post subject: Reply with quote

thanx for the link...i think i have found the best solution yet....

I have mythstream pulling a live stream right off my pvr250...no more need to set a recording Smile
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Xsecrets



Joined: 06 Oct 2003
Posts: 4978
Location: Nashville, TN

PostPosted: Fri Jun 03, 2005 9:24 am    Post subject: Reply with quote

That sounds pretty cool. as good howto would be interesting to see. Wink
_________________
Have a question search the forum and have a look at the KnoppMythWiki.

Xsecrets
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rogabean



Joined: 13 Dec 2004
Posts: 33
Location: Orlando, FL (U.S.A.)

PostPosted: Fri Jun 03, 2005 11:02 am    Post subject: Reply with quote

odd that your web controls aren't working. I use MythstreamTV on a daily basis and have never had an issue. I just fire up mythweb in a webbrowser... which I have set on port 5190. It streams to me on port 8080 and the vlc control port is 8002 (default).

I stream to MPlayer at work. When I need to pause or reboot my work machine, I simply hit pause on the web control in mythweb's stream page. When I come back I hit the pause button again which picks up the stream where it left off, then reconnect with MPlayer.

(hitting play after hitting pause will restart the stream from the beginning... hit pause to pause and pause to unpause)

I'd be interested in seeing how ya got it streaming right off without setting a recording though Smile
_________________
...you pervy Windows™ fancier!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Fri Jun 03, 2005 11:13 am    Post subject: Reply with quote

well, my php skills are beginner level at best....I will put something together over the weekend if time allows.

Be forwarned, it will be a manual install. I think I have about 15 new files and a few modifed baseline files.

Also, it is currently only configed for NTSC as the tuner needs frequency values. I looked into other sets....man, there are are alot.

That's the best thing about standards...there are so many to choose from!
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Fri Jun 03, 2005 12:05 pm    Post subject: Reply with quote

EDITED 6-June-2005 EDITED

quick and dirty for now if anyone wants to play with mythstream LIVE

couple notes...

    - i'm on R5A16
    - requires 250 or 350
    - assumes standard box (/myth/stream & /var/www/mythweb )
    - I had working mythstream for recordings
    - only works fo NTSC
    - I'm not a PHP expert
    - Code currently scrapes status.php to provide tuner status DDL for manual tuner selection


1) reconfigure and build vlc with --enable-pvr config option

2) www-data needs to be in video linux group Then restart apache.

3) untar http://www.chrismenard.com/mythstreamLive/myth_stream.tar into /myth/stream - assure reasonable pemissions

Code:
cd  /myth/stream
tar -xvf myth_stream.tar


3b - New) edit /myth/stream/parseTunerStatus.sh - update the variable MYTH_WEB_STATUS to point to URL of mythweb status page

4) untar http://www.chrismenard.com/mythstreamLive/var_www_mythweb.tar into /var/www/mythweb (this will put files in /var/www/mythweb and in /var/www/mythweb/themes/Default

Code:
cd /var/www/mythweb
tar -xvf var_www_mythweb.tar


5) edit /var/www/mythweb/themes/Default/mythstreamtvLive_createfile.php and put YOUR server IP in 4 places (search for IP)

6) backup you copy of /var/www/mythweb/includes/channels.php
Code:
cp /var/www/mythweb/includes/channels.php /var/www/mythweb/includes/channels.php.save


7) add this function to the bottom of channels.php before last curly bracket '}'
Code:
    function display_current_program($start_time, $end_time) {
        global $Page;
        $timeslots_left = num_time_slots;
        $program = &$this->programs[0];
        // Get a modified start/end time for this program (in case it starts/ends outside of the aloted
 time
            $program_starts = $program->starttime;
            $program_ends   = $program->endtime;
            if ($program->starttime < $start_time)
                $program_starts = $start_time;
            if ($program->endtime > $end_time)
                $program_ends = $end_time;
        // Calculate the number of time slots this program gets
            $length = (($program_ends - $program_starts) / timeslot_size);
            $timeslots_used = ceil($length);
        // Increment $start_time so we avoid putting tiny shows (ones smaller than a timeslot) into the
ir own timeslot
            $start_time += $timeslots_used * timeslot_size;
            $timeslots_left -= $timeslots_used;
        #if ($timeslots_left > 0)
            $Page->print_program(&$program, $timeslots_used, $start_time, &$this->channum);
        // Cleanup is good
            unset($program);
    }


Cool backup your copy of /var/www/mythweb/themes/Default/theme.php
Code:
cp /var/www/mythweb/themes/Default/theme.php /var/www/mythweb/themes/Default/theme.php.save

9) add a link for 'Stream Live TV' to theme.php around line 164 - you'll see similar lines of code

Code:
 <a href="mythstreamtvLive.php"><?php echo 'Stream Live TV' ?></a>
                &nbsp; | &nbsp;


10) go to mytweb and try link
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA


Last edited by khrusher on Thu Jun 23, 2005 6:19 am; edited 5 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
rogabean



Joined: 13 Dec 2004
Posts: 33
Location: Orlando, FL (U.S.A.)

PostPosted: Fri Jun 03, 2005 2:44 pm    Post subject: Reply with quote

nice writeup man... will give this a try later this evening and see how it goes Smile
_________________
...you pervy Windows™ fancier!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Fri Jun 03, 2005 4:07 pm    Post subject: Reply with quote

weird things seem to happen when the card is already recording. i got odd DVD divice errors, vlc log.txt file is full of bad requests...and ultimatly the WMP gives up and throws an error.

After I realized that /dev/ video0 was busy, I switch mythstreamtvLive.sh
to /dev/video1 and all ws well. maybe we need some tuner status smarts. At least a way to select on the device on the parameter form.
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Fri Jun 03, 2005 4:49 pm    Post subject: Reply with quote

just found out that while I was testing this stuff from work today, my wife was recording a program....tonight she was watching the recording. the recording was filled with my test...it kept switching to 'random' channels

negative WAF points. telling her that 'now I can watch sox from work' didnt help any....surprizing Rolling Eyes
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
rogabean



Joined: 13 Dec 2004
Posts: 33
Location: Orlando, FL (U.S.A.)

PostPosted: Sat Jun 04, 2005 9:23 am    Post subject: Reply with quote

so far I'm not having much luck...

I've gotten the page to come up properly... I am having to make modifications to the mythstreamtvLive.sh script. You had your own IP's hardcoded in there as well as port numbers.


Will let ya know how it goes... right now it doesn't want to bind to port 8080, while my mythstreamtv will bind streams to it just fine.


will continue working on this after lunch some.

update: ok I have it working now.


I took out your internal IP addresses from the mythstreamtvLive.sh script. There is no need for IP addresses to be there.

here is my modified changes:

Code:

if [ $PROTOCOL = "mms" ]; then
        vlc -I http --http-host=:8002  pvr:/dev/video0:norm=${FREQ_TYPE}:size=720x576:bitrate=3000000:maxbitrate=4000000:frequency=${FREQ} --sout-transcode-fps=$FPS --sout-transcode-deinterlace ":sout=#transcode{vcodec=$VCODEC,acodec=$ACODEC,vb=$VB,ab=$AB,scale=$SIZE}:std{access=mmsh,mux=asfh,url=:8080}"
      elif [ $PROTOCOL = "http" ]; then
         vlc -I http --http-host=:8002  pvr:/dev/video0:norm=${FREQ_TYPE}:size=720x576:bitrate=3000000:maxbitrate=4000000:frequency=${FREQ} --sout-transcode-fps=$FPS --sout-transcode-deinterlace ":sout=#transcode{vcodec=$VCODEC,acodec=$ACODEC,vb=$VB,ab=$AB,scale=$SIZE}:std{access=http{user=$HTTP_USER,pwd=$HTTP_PWD,mime=video/x-ms-asf},mux=asf,url=:8080}"
      fi

      if [ -f /var/tmp/STREAMSTOP ]; then
         rm -f /var/tmp/STREAMSTOP
      fi

vlc -I http --http-host=:8002  --sout-transcode-fps=$FPS --sout-transcode-deinterlace $1 ":sout=#transcode{vcodec=$VCODEC,acodec=$ACODEC,vb=$VB,ab=$AB,scale=$SIZE}:std{access=http{user=$HTTP_USER,pwd=$HTTP_PWD,mime=video/x-ms-asf},mux=asf,url=:8080}"



The thing that would be different for anyone using the script would be the port at the end of each line. That would be the port they are streaming on. The first port is the control port and does not need to be routable outside your network. So unless the port was changed from the default this should not need to be changed.

The issue I am seeing right now is that "Stop Streaming" does not actually stop the stream. I have to go to the stream recordings page and hit stop stream. Then it actually dies. I am working on that now to see why.
_________________
...you pervy Windows™ fancier!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rogabean



Joined: 13 Dec 2004
Posts: 33
Location: Orlando, FL (U.S.A.)

PostPosted: Sat Jun 04, 2005 9:50 am    Post subject: Reply with quote

A little more testing.

It seems that we need a way for MythTV to actually see the tuner is in use.

The current script isn't actually talking to the backend server. It bypasses myth and is accessing the card directly. Hmmmm

That wouldn't be a big deal if Myth could at least tell that "hey something else is currently using /dev/video* atm"

So right now it requires that:

1. Nobody is actually trying to watch TV at home

&&

2. Nothing is going to record while watching TV.


There is the option of dedicating a Tuner card to this, but seems a bit much just for streaming TV.
_________________
...you pervy Windows™ fancier!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Sat Jun 04, 2005 12:33 pm    Post subject: Reply with quote

I agree with the tuner status check. maybe a parse of the status html output. I think a drop down to select tuner is required too....maybe the drop down can be filtered to show idle tuners

my apache server is running on port 8080...so I chose 8001/2

a simple way to stop the stream would be nice too. unlike streaming a recording, livetv never ends. Smile

If anyone in PAL land wants to play, you'll need to add your channel frequencies to the config file.
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
rogabean



Joined: 13 Dec 2004
Posts: 33
Location: Orlando, FL (U.S.A.)

PostPosted: Sat Jun 04, 2005 1:01 pm    Post subject: Reply with quote

yeah I run my apache on 5190 and stream on 8080 (8001 isn't an option for me with work firewall.. had to select ports that would work)

but putting the IP in the mthstreamtvLive.sh script isn't needed.. just ":port"

one thing I saw though was that if you are streaming live TV, the backend status does not recognize that tuner 1 is "recording".

I'm gonna do a little research and see if the input to VLC can be grabbed from mythbackend itself.
_________________
...you pervy Windows™ fancier!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
khrusher



Joined: 13 Apr 2004
Posts: 889
Location: Groton, MA

PostPosted: Sat Jun 04, 2005 1:35 pm    Post subject: Reply with quote

I was thinking as a quick and dirty...a parse of /mythweb/status.php

check for:

Code:
Encoder 1 is local on mythtv and is not recording.
Encoder 2 is local on mythtv and is not recording.


and see which tuners are idle, if multiple then a quick parse of the schedule to see which tuner is scheduled to record next, then use another tuner (but, I think my usage will be during the day when little recording is scheduled):

Schedule
The next 10 shows that are scheduled for recording:
Sun 6/5 10:29 AM - Encoder 1 - TV Land - The Munsters
The Munsters (10:30 AM-11:00 AM)
The Fregosi Emerald
_________________
R5F1 - Dell P4 2.4Ghz 500MB - PVR250 x 2 - GeForce FX 5200 - Onboard sound/NIC 80GB ATA/250GB ATA/400GB SATA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    knoppmyth.net Forum Index -> MythTV All times are GMT - 8 Hours
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group