maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mediaserv: on-demand video transcoding (https://talk.maemo.org/showthread.php?t=10948)

aflegg 2007-10-28 10:20

Re: mediaserv: on-demand video transcoding
 
The problem with that is that not everyone will have it running on an external facing network interface.

The current IP detection should work well on an POSIX system, but adding a `url' configuration option as well as IP sounds like the best bet.

aflegg 2007-10-28 20:17

Re: mediaserv: on-demand video transcoding
 
For those of you who haven't yet seen mediaserv in action, the release of 0.04 proper coincides with a video demo of it:

http://www.maemopeople.org/index.php...v0_04_and_demo

zerojay 2007-10-29 01:52

Re: mediaserv: on-demand video transcoding
 
mediaserv refuses to play video files which are stored in directories with spaces in their names. Mencoder can be seen doing it's work, but attempting to play the video results in Media Player stopping immediately as soon as you try to play it.

Spaces in the video filenames themselves work fine.

Everything stored in my /Movies/ directory plays perfectly. Everything in /TV Shows/ does not. Moving a file I've attempted to play into the root of my share directories allows the video to play fine, even if it didn't work in the /TV Shows/ directory. So... as far as I can tell, it's a problem with spaces in the path to the video file.

aflegg 2007-10-29 09:07

Re: mediaserv: on-demand video transcoding
 
That's a bit weird, though, as my demo included a file in "/data/Video/Family Guy - Season 4/12 - Something or other.avi"

zerojay: using microb or Opera? Playing through the web browser or Video Center? There are certainly a number of bugs in Opera/microb/Video Center with non-alphanumeric characters in URIs - I thought I'd worked round them, though :-(

Your evidence is fairly persuasive, though.

zerojay 2007-10-29 09:45

Re: mediaserv: on-demand video transcoding
 
Microb was used with the web interface opening to media player.

zerojay 2007-10-29 16:03

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by rm_you (Post 87422)
The beta seems to work fairly well for me (I haven't tried linking it up with my MythTV yet though, no time at the moment for that) except the handling of the IP detection is now broken with my setup.

I have my server behind a router, meaning it has an internal IP like 192.168.*, but the outside address is a FQDN. It was working fine with just setting the $ip to my FQDN in version 0.02, but now it fails with "Unable to open socket my.domain.com:8090 - Cannot assign requested address".

This means I have to make $ip my internal IP and hardcode $URL to be my external FQDN, or else it doesn't point my browser to the right place. Not a big deal, just something to be aware of! (Also, I use VMWare, and when I let it autodetect my IP it chooses the last available interface, VMWare's vmnet, over eth0... I suppose mine is a exceptional case though >_>)

What changes did you make exactly? I want my mediaserv to be accessable from the outside as well.

aflegg 2007-10-29 16:52

Re: mediaserv: on-demand video transcoding
 
I've got mediaserv externally accessible by having my router/firewall port forward 8090 to the internal server running it.

The next version should allow the separate specification of `url' and `ip', though, if your external IP is not known to your server.

muki 2007-11-15 11:27

Re: mediaserv: on-demand video transcoding
 
Is there a version for OSX on a G4?

aflegg 2007-11-15 13:50

Re: mediaserv: on-demand video transcoding
 
Apparently it works on OS X, there's nothing Intel specific in it since it's written in Perl.

muki 2007-11-15 13:58

Re: mediaserv: on-demand video transcoding
 
ok thanks, I hadn't realised that :o

aflegg 2007-11-15 16:54

Re: mediaserv: on-demand video transcoding
 
No probs - give me a shout if you have a problem.

muki 2007-11-15 19:56

Re: mediaserv: on-demand video transcoding
 
aflegg: thanks. First I should state I am on 10.3.8, have studiously avoided PERL for many years :) and only used my Mac Mini as a file server for a long time now. I can just about find my way around the system from the terminal without too much danger of trashing it :)

Running install.sh borked at the "u" option for "cp" so I removed it and the script worked. Downloaded 770-encode.pl, chmod +x and moved it to /usr/bin. Tried running mediaserv and as expected got "Can't locate XML/RSS.pm..." so then I ran "perl -MCPAN ...". Several thousand lines later it borked with the following (I have edited out long lines):

Quote:

Manifying blib/man3/XML::RSS.3pm
/usr/bin/make -- OK
Running make test
/usr/bin/perl "-MTest::Manifest" "-e" "run_t_manifest(0, 'blib/lib', 'blib/arch')"
Level is
Test::Manifest::test_harness found [t/load.t <LONG-TEXT-REMOVED>]
t/load.........................NOK 1# Failed test (t/load.t at line 22)
# Tried to use 'XML::RSS'.
# Error: Can't locate XML/Parser.pm in @INC (@INC contains: <LONG-TEXT-REMOVED>) at /Users/myname/.cpan/build/XML-RSS-1.31/blib/lib/XML/RSS.pm line 4.
# BEGIN failed--compilation aborted at /Users/myname/.cpan/build/XML-RSS-1.31/blib/lib/XML/RSS.pm line 4.
# Compilation failed in require at (eval 4) line 2.
FAILED--Further testing stopped: XML::RSS did not compileok 2 - use XML::RSS::Private::Output::Base;
make: *** [test_dynamic] Error 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
Any help appreciated. I have captured the whole terminal history if it will help.

aflegg 2007-11-16 12:54

Re: mediaserv: on-demand video transcoding
 
GeneralAntilles has got it working. For some reason XML::Parser isn't available - presumably it failed to build earlier.

Unfortunately, I've not got a Mac anymore, so can't detailed debugging help :-(

Sorry for the inconvenience.

zeez 2007-11-16 13:09

Re: mediaserv: on-demand video transcoding
 
Does anyone running OS2008 have this working ? It worked with OS2007 for me but now the mediaplayer says "Unable to find media file"

aflegg 2007-11-16 13:18

Re: mediaserv: on-demand video transcoding
 
Hmm, odd.

Could it be related to https://bugs.maemo.org/show_bug.cgi?id=2186 ? Until I get an N810, identifying this problem will be a little tricky :-/

muki 2007-11-16 15:43

Re: mediaserv: on-demand video transcoding
 
Progress! Full details later when I have trawled my history, short version:

- Updated CPAN
- downloaded and installed expat (usual way, nothing to do with PERL)
- CPAN install of XML::Parser now worked (probably could have skipped this now and let CPAN get in the next step)
- CPAN install of XML:RSS now worked
- renamed 770-encode.pl to 770-encode (no ".pl", could have also used a link)
- linked /usr/bin/mencoder to actual file installed in ffmpegX directory
- As an extra step I moved the data directory to an external drive and link to it there to avoid filling up my internal drive.
- Finally I needed the IP address in the config file.


Hope the above at least provides some tips for other OSX users. Not quite there as I can't seem to access the file until it is fully converted (correct?) and selecting one in the Opera browser brings up KMPlayer (on my 770) but the video never appears. I can copy the link direct into mplayer, where it does play. Also just realised I need a link to mplayer if I am reading the mediaserv log correctly.

The log shows other "sysread() on closed filehandle..." errors while, I think, the file is being converted.

aflegg 2007-11-17 10:26

Re: mediaserv: on-demand video transcoding
 
Hmm, very odd - you should be able to watch the video whilst it's transcoding (assuming your PC is fast enough; it'd have to be very old or busy to not keep up on "smallest").

Can you send me the entire log, the output of `perl -V' and anything else you think pertinent?

Thanks in advance,

Andrew

RipTorn 2007-11-18 05:23

Re: mediaserv: on-demand video transcoding
 
im using a N800 OS2007, when I try to stream a file it just waits on buffering, the error on Mediaserv log files are:

Waiting for data from data/multimedia/test.avi.avi...
2007/11/17 05:03:28 6014 - NOTE! sysread() on closed filehandle IN at ./mediaserv line 722.
2007/11/17 05:03:28 6014 - NOTE! Use of uninitialized value in numeric gt (>) at ./mediaserv line 723.

im using Fiesty Ubuntu server

770-encode seems to work fine and doesn't display any errors when encoding
I've tried several media players to play the stream it does the same in all of them.

im using:

perl -v

This is perl, v5.8.8 built for i486-linux-gnu-thread-multi

Also I thought it would be best to move my post from Jaffa's Projects to here :)

Cheers
Rip

aflegg 2007-11-18 11:19

Re: mediaserv: on-demand video transcoding
 
Thanks for that. Unfortunately the snippet of the log isn't the bit I need to see - it's basically saying that test.avi.avi doesn't exist, which suggests the encoding isn't working.

Can you delete the existing log, run it again and then send me the *entire* log (or attach it here)?

You've got 770-encode installed as "770-encode" and it's on your PATH? Or you've altered the appropriate config file setting to point to where you have it/what it's called?

Sorry for the inconvenience in getting it working.

Cheers,

Andrew

aflegg 2007-11-18 15:19

Re: mediaserv: on-demand video transcoding
 
mediaserv v0.05 is out: with a number of small bug fixes/enhancements requested here, it's primary purpose is to:

a) be at its new website: http://mediautils.garage.maemo.org/
b) be aware that it can use both tablet-encode or 770-encode.

Comments, as ever, welcome.

RipTorn 2007-11-18 18:06

Re: mediaserv: on-demand video transcoding
 
Cool, well im one step closer it now encodes on the fly :D (since I upgraded to 0.05)
The only thing thats out of the ordinary is the Audio Codec gives out a horrible sequel (on all of my media players), I am guessing it has something to do with the codecs I have installed :\ I can't work it out at all. In the mean time I can use copy audio codec in the tablet-encode settings.

Thanks for the great program :)


Cheers
Rip

zeez 2007-11-18 18:18

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by aflegg (Post 95755)
Hmm, odd.

Could it be related to https://bugs.maemo.org/show_bug.cgi?id=2186 ? Until I get an N810, identifying this problem will be a little tricky :-/

Yep that seems to be the problem... Man you're good at this :)

RipTorn 2007-11-18 19:12

Re: mediaserv: on-demand video transcoding
 
Ok, fantastic! I have reinstalled all my audio codecs on the server and it all seems to be running perfect :) The only future feature I can think of is possibly a UPNP feature so we don't have to copy and paste URLs into the media player of choice.

Thanks heaps!

Cheers
Rip

muki 2007-11-20 15:20

Re: mediaserv: on-demand video transcoding
 
Andrew, I have emailed logs etc to your bleb address

aflegg 2007-11-20 16:33

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by muki (Post 97750)
Andrew, I have emailed logs etc to your bleb address

Thanks, appreciated. I'll try and have a look at them at some point in the next few evenings.

Sorry for the delay & inconvenience.

Cheers,

Andrew

Tragos 2007-11-20 23:04

Re: mediaserv: on-demand video transcoding
 
Thanks, man! This is awesome!

I have been planning to do a similar program myself, but I haven't had time or perl skills enough to do this. Instead I have been using some shell scripts to launch VLC on my Linux server (Ubuntu Feisty) and do the transcoding and streaming. However, this has required SSH'ing to the server first and launching those scripts manually. I find your solution much more elegant than mine.

I have a few humble feature requests:
  1. Possibility to choose encoding preset from the Web interface (also requested by mplawner).
  2. An option to continue encoding and keep the file when keepResults = 0
    OR a button to kill the running mencoder processes when keepResults = 1.

    Sometimes I want the encoding to continue when I close the video player. Then I can later transfer the encoded file on my Nokia. But if I opened a wrong video by mistake, I would also like to be able to terminate the encoding easily.
  3. Possibility to shut down mediaserv after certain amount of inactivity.

aflegg 2007-11-21 11:58

Re: mediaserv: on-demand video transcoding
 
Thanks - added to the TODO list.

desht 2007-11-25 17:37

Re: mediaserv: on-demand video transcoding
 
1 Attachment(s)
First off, let me say what a great bit of software this is. Just what I was looking for!

I saw the opportunity for a couple of little enhancements to the MythTV browsing functionality, and I'm attaching a patch (context diff):

1) Default sort order for MythTV (and presumably Freevo, but I'm not really familiar with that) recordings is currently by filename, which gives a fairly random-looking order in the resulting web page, since MythTV filenames don't contain any title information. So I added sorting by show title and subtitle (see the byTitle() sub) which gives us a proper alphabetical show order for MythTV recordings (and should still look fine for directories of regular video files).

2) I have quite a few recordings and found that running mythname.pl once for every recording to get the MythTV metadata is very slow. So I added some functionality into mediaserv to prefetch the MythTV meta-data from the MySQL mythconverg database, which makes rendering pages of MythTV recordings much much faster. mediaserv *should* re-fetch the metadata if it finds anything missing (in the event that new recordings are inserted into the database after mediaserv starts up), but this needs some more testing. See the new sub getMythMetaData(), etc.

I hope this is useful!

aflegg 2007-11-25 18:44

Re: mediaserv: on-demand video transcoding
 
desht, thanks very much - looks really useful.

Do you mind attaching your patch to the garage project? Then I won't forget to apply it :-)

https://garage.maemo.org/tracker/?at...55&func=browse

Thanks in advance,

Andrew

desht 2007-11-25 19:30

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by aflegg (Post 99733)
Do you mind attaching your patch to the garage project? Then I won't forget to apply it :-)

Sure thing - that's done now.

Des.

SethCohn 2007-12-29 05:00

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by Tragos (Post 97999)
[*]An option to continue encoding and keep the file when keepResults = 0
OR a button to kill the running mencoder processes when keepResults = 1.

Sometimes I want the encoding to continue when I close the video player. Then I can later transfer the encoded file on my Nokia. But if I opened a wrong video by mistake, I would also like to be able to terminate the encoding easily.
[*]Possibility to shut down mediaserv after certain amount of inactivity.

And/OR

setting to limit number of mencode processes to 1 (or 2 or 3, etc),
for slower machines. Connecting to a video, then disconnecting, and connecting to a second one, on a slow machine, becomes unwatchable on the second video, since the machine is still grinding away at the first video _and_ the second one.

Also:

bug report - in the browser, clicking on the thumbnail seems to not correctly load the video (to open/save), while clicking on the title does.

blackoper 2008-01-01 04:15

Re: mediaserv: on-demand video transcoding
 
Any idea why these encodes take about a minute to open in mplayer or the default media app? I download the entire show to SD storage and then watch it so it's not a streaming issue. The non-encoded original avi files open up right away.

aflegg 2008-01-03 12:44

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by SethCohn (Post 117142)
bug report - in the browser, clicking on the thumbnail seems to not correctly load the video (to open/save), while clicking on the title does.

That's very odd - since the HTML looks like:

Code:

<a href="..."><img ... />title...</a>
I'll investigate.

blackoper 2008-02-17 19:03

Re: mediaserv: on-demand video transcoding
 
anyway to get mediaserv to work with dvd images like iso img?

kidalien745 2008-02-29 03:04

Re: mediaserv: on-demand video transcoding
 
1 Attachment(s)
Not sure if a post here or at the garage will be seen first:

I'm having the same problem as chilli_peppa in this thread.

Despite not being connected to the mediaserv anymore (from any source), transcoding continues until the file is done. I'm attaching the log file of me watching about 3 seconds of a movie, then waiting an additional 3 minutes for the transcoding to stop. At that point, I killall mencoder and killall mediaserv. I removed extraneous lines, and saved as .txt so the forum would let me attach it.

Thanks

-alien

hp770 2008-03-01 03:03

Re: mediaserv: on-demand video transcoding
 
I'm really excited about this software, however I have two problems;

1) I've added my MythTV setup information, however when I browse to http://server:8090 I see all the media directories, however no MythTV link.

2) I can't see the trascoded output -- both on a 770 as well as through VLC. On my linux server I see the transcoder starting, memcoder is active and taking lots of CPU, but no output. VLC just sits there, I can't view the video in safari.

I'd appreciate any help, as I would love to get the streaming and MythTB working!!!

hp770 2008-03-01 06:20

Re: mediaserv: on-demand video transcoding
 
A little more progress on this:

I can see the myth recordings if I add a symlink to the mythtv rec directory inside $basedir. (my mythtv setup is on a separate disk). Ideally it would be nice for mediaserv to notice if mythDir is outside baseDir and add a 'MythTV' folder at the root.

I can play the transcoded video stream via Mplayer on a laptop (hooray). this was a transcoded MPEG2 file from mythtv. However, when I try on the 770 I get a 'codec not supported' error in the media centre. I'm using the lasted OS2007HE

blackoper 2008-03-18 19:39

Re: mediaserv: on-demand video transcoding
 
I use mplayer to play the files HP770 seems to work better and os 2008

Picklesworth 2008-04-18 03:16

Re: mediaserv: on-demand video transcoding
 
Getting an odd problem here. This is pretty much out of the box configuration; mediaserv is working.

However, I must access it by the hostname as known by the computer running the server. That is, dmccall-laptop.local. If I access it by IP address (192.168.1.120) I am redirected to 192.168.1.120-laptop.local, which is neither the right hostname nor the right IP address... it is simply nonsense.
For some reason, Maemo does not resolve local hostnames out of the box (and I still have not figured out how to make it do so, or if it is even possible. Alas, this thread has not helped). Adding dmccall-laptop.local to /etc/hosts and then accessing the server with that did the trick, but I find doing so very unfortunate and ugly. Why is it behaving like this?

Jaffa 2008-04-18 12:34

Re: mediaserv: on-demand video transcoding
 
Things like the RSS feed require the full URL to be known. mediaserv asks the OS for this and - if it's misconfigured - will get the wrong value.

Modify the config file in ~/.mediaserv to set "url = 'http://192.168.1.120:8090'".

Hope that helps,

Andrew


All times are GMT. The time now is 02:18.

vBulletin® Version 3.8.8