Notices


Reply
Thread Tools
Posts: 393 | Thanked: 112 times | Joined on Jul 2007
#31
Here I was hoping to get this up and running under Winbloze just because!

Installed activestate, check.
ppm install xml::rss, check.
Got unxutils, check.
Gotta copy of mplayer + mencoder in the path and checked 770-encode works, check.

All good so far...

All paths set, setup a $home path and started mediaserv....

Code:
C:\Documents and Settings\Administrator\Desktop\mediaserv>perl -w mediaserv
'ifconfig' is not recognized as an internal or external command,
operable program or batch file.
mediaserv running at http://reaper:8090
Parent daemon running.
POSIX::setsid not implemented on this architecture at mediaserv line 576.
Blast - well ... it detected the IP fine anyway so let's comment out line 75...

Little bit of reading around - I saw where you got the idea for the server daemon and was hoping to understand unix processes and p'raps change things to suit a win32 environment.

No chance of that happening anytime soon - need to learn Perl and need to re-learn unix processes to understand what needs to be done, lol. I scoured online for a bit and foudn that Setsid and the like aren't ever going to have a win32 equivelant...oh well.

From what little I do know - does all this setting of PIDs really matter in the Win32 world? I don't care for a daemon yet - initially let's get this running from the command line and then perhaps transfer things to Win32:aemon in the future..

So anyways . . . . comment out lines 576 and 498, and fix various paths to mediaserv.log (remove /tmp/ ) and see what we get.

[code]
mediaserv running at http://reaper:8090
Parent daemon running.[code]

Good stuff....

Go visit http://reaper:8090....browser sits there doing nothing. Hmmmmm.
Refresh page. Refresh page. Refresh page...
Check logs:
[code]
2007/10/26 23:36:52 -3448 - NOTE! forked new child, we now have 1 children
2007/10/26 23:37:00 -3448 - NOTE! forked new child, we now have 2 children
2007/10/26 23:37:26 -3448 - NOTE! forked new child, we now have 3 children
2007/10/26 23:37:26 -3192 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:26 -3192 - disconnect:192.168.1.100 - ct[1]
2007/10/26 23:37:51 -2500 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:51 -2500 - disconnect:192.168.1.100 - ct[1]
2007/10/26 23:37:51 -1996 - 192.168.1.100 http://reaper:8090/ - ct[1]
2007/10/26 23:37:51 -1996 - disconnect:192.168.1.100 - ct[1]
[code]


Well - stuff is happening. I think. Child processes are being spawned, etc...but the browser displayed nothing. Hmmm, still something wrong...

I noticed it reading files from a /static/ directory - this seemed to cause hangups. Copied /resources/ to /static/ and hurrah! Stuff is showing up in the browser now

But erm - selecting various directories, etc and it's still playing up... I kinda understand the reasons for disassociating from the controlling terminal when daemonizing a server - but atm I just want this running in the current term. fork() should work ok in activestate so I wonder why its screwing up.






Or maybe this is a chance to just stick with Ubuntu

[Dammit - if I can find a working mencoder for the NSLU2 I'd set it up there!]
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#32
Getting it working on Windows would be handy, and something I'd like to do at some point - preferably before v1.00 (got at least 96 versions between now and then to get it sorted). But, at the moment, stabilising it on non-Windows platforms is more important to me - partly because a) it's easier, b) it's more use to me and c) Windows users have Orb it turns out.

However, having said that, anyone who submits patches to get it working on Windows as well will certainly get a pint from me!

I'm not going to announce every version on ITT, using my Maemopeople blog which is syndicated to planet.maemo.org instead for the major releases; but v0.04 should fix all the problems reported here (apart from rm_you's NAT problem):

http://www.bleb.org/software/maemo/m...rv-0.04.tar.gz

Complete changelog:
  • Use Gnome or totem-video-thumbnailer in preference to player for thumbnails, if possible (provided by Andreas Behr).
  • Don't clobber configuration when updating installation.
  • Added MP4 to default set of media extensions (reported by Sebastian Moeller).
  • Improve thumbnail generation when falling back to mplayer.
  • Added support for additional 770-encode options (reported by rm_you and Sebastian Moeller).
  • Default IP detection now uses default interface rather than first with 0.0.0.0 gateway (reported by rm_you).
  • ifconfig may not be in PATH (reported by Daniel Yerga).

Again, all problem reports (and patches) welcome :-)
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
Posts: 474 | Thanked: 30 times | Joined on Jan 2006
#33
Initial thoughts: extremely badass.

That pretty much sums it up, actually. Well done!
 
Posts: 76 | Thanked: 19 times | Joined on Apr 2007
#34
I have a request for a futuure version.
Basically, i would like to choose the quality 'on the fly.' Thought of this for using best when on my lan and smallest (friggin' asynchronous dsl!) when tunneling home from the wan. originally i was going to set up two processes w/two different config files (different ports/quality settingd), but realized the config file location is 'hard coded.' (ok, it's a script, i know) But, it got me thinking... maybe you coulld have different 'bandwidth' options onn the page iitself that calls different quality settiings?
 
luca's Avatar
Posts: 1,137 | Thanked: 402 times | Joined on Sep 2007 @ Catalunya
#35
If I knew perl I'd send you patches instead of requests , just a couple of quick notes: while I learn perl (or someone else does it) to contribute vdr support, I just added vdr to the list of extensions, and at least I can see my recordings on the tablet.
One minor problem is that names of directories (that's all what matters with vdr recordings) with special characters (αιρ, etc.) are messed up: they apparently are sent in utf-8 but there seems to be no character-encoding header, so the browser defaults to iso8859-1 (if I manually change the encoding to utf-8 everything displays fine).
Another thing is that I have no way to pick the audio track for multilingual recordings (the information on the language on each track is in info.vdr). Additionally it seems that mencoder picked the second language instead of the first one, but I'll have to check more carefully if that's really the case.
 
luca's Avatar
Posts: 1,137 | Thanked: 402 times | Joined on Sep 2007 @ Catalunya
#36
Originally Posted by luca View Post
Additionally it seems that mencoder picked the second language instead of the first one, but I'll have to check more carefully if that's really the case.

That's actually the case: if I add "-aid 0" (I did that in 770-encode) I get the first language. Probably the problem is that even if the id is 0, mplayer -identify lists 1 as the first one and 0 as the second.
 
Posts: 76 | Thanked: 19 times | Joined on Apr 2007
#37
This is, what I feel, is my first useful contribution to this community, and I'm happy it is for such a great program. I've been looking for something this simple for quite some time, and again, thank you, aflegg, for creating it.

Ok... as a service, here's the steps and here's the code:
As normal user, extract mediaserv to home directory and install as per the standard instructions.

Then:
$ sudo mv -rv ~/mediaserv /usr/local/share/
$ sudo ln -s /usr/local/share/mediaserv/mediaserv /usr/local/bin/mediaserv

Create the file, /etc/init.d/mediaservd, with chmod +x 'ed, with the one modification:
Replace RUNASUSER=user with user who installed mediaserv

Here's the contents of /etc/init.d/mediaservd:
(Sorry, it is Q&D, but it's good enough starting point for someone how is more experienced than myself to fix up)
Code:
#!/bin/sh

### BEGIN INIT INFO
# Provides:        mediaservd
# Required-Start:  $network $remote_fs $syslog
# Required-Stop:   $network $remote_fs $syslog
# Default-Start:   2 3 4 5
# Default-Stop:    0 1 6
# Short-Description: Start mediaservd daemon
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

. /lib/lsb/init-functions

NAME=mediaservd
DAEMON=/usr/local/bin/mediaserv

test -x $DAEMON || exit 5

RUNASUSER=user
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true

case $1 in
        start)
                log_daemon_msg "Starting mediaservd server" "mediaservd"
                if [ -z "$UGID" ]; then
                        log_failure_msg "user \"$RUNASUSER\" does not exist"
                        exit 1
                fi
                su -l $RUNASUSER -c mediaserv
                log_end_msg $?
                ;;
        stop)
                log_daemon_msg "Stopping mediaservd server" "mediaservd"
                killall mediaserv
                log_end_msg $?
                ;;
        restart|force-reload)
                $0 stop && sleep 2 && $0 start
                ;;
        try-restart)
                if $0 status >/dev/null; then
                        $0 restart
                else
                        exit 0
                fi
                ;;
        reload)
                exit 3
                ;;
        status)
                ps -fu $RUNASUSER | grep mediaserv >>/dev/null
                status=$?
                if [ $status -eq 0 ]; then
                        log_success_msg "mediaservd server is running."
                else
                        log_failure_msg "mediaservd server is not running."
                fi
                exit $status
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
                exit 2
                ;;
esac
 
Posts: 76 | Thanked: 19 times | Joined on Apr 2007
#38
Also, may I request that these additional extensions be added to the future version:
mkv mpeg rmvb
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#39
Thanks for all the good feedback, I've added all of these to the todo list.

mplawner: you can modify ~/.mediaserv/config to add the additional extensions you require until v0.05 is released which will feature them as defaults.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
Now known as
Jaffa
 
rm_you's Avatar
Posts: 98 | Thanked: 189 times | Joined on Jul 2007 @ San Antonio, TX
#40
I'm not sure if this utility is installed on all distributions of linux by default (I would hope something similar is, at least) but this seems like a better way to solve the IP detection issue...

I commented/removed lines 78,79,80 and added the following:
Code:
$ip = `tracepath google.com | head -n 1 | awk '{ print \$2 }'`;
It should grab the ip for the very first hop towards the outside world (IE, your external facing network interface). I then added an unless($URL) just like the IP one, and am setting that manually. It seems to work well.

Anyone else have any comments on this?

Last edited by rm_you; 2007-10-27 at 22:29.
 
Reply


 
Forum Jump


All times are GMT. The time now is 13:40.