![]() |
mediaserv: on-demand video transcoding
Hi all,
Some of you saw a couple of days ago my initial announcement of mediaserv, an on-demand web server for getting access to your videos through your Internet Tablet's web browser, RSS reader or Video Center. I'm very pleased to announce a new version after lots of good feedback. http://www.bleb.org/software/maemo/mediaserv-sm.png http://www.bleb.org/software/maemo/mediaserv2-sm.png http://www.bleb.org/software/maemo/mediaserv-vc-sm.png If you've got a lot of videos and have a Linux, Unix or (probably) a Mac OS X box, I'd love to hear what you think. Thanks in advance, Andrew Edit: v0.05 has now been released and can be found at my mediautils website. |
Re: mediaserv: on-demand video transcoding
Hi i tried it out, however i had the following problem:
I could browse my files but whenever i tried to play one it just kept on loading and nothing ever happened. (Not only on my N800 but also when i would connect with my regular pc) any ideas ? Besides that: Thanks for the effort i think this is going to be great ! |
Re: mediaserv: on-demand video transcoding
zeez: I'd need to see your /tmp/mediaserv.log - if you can ping it on over to me, that'd be great.
The first test is to see if 770-encode on its own works against the file, but there aren't any known show-stopping bugs in this release. Finding the first would get you a prize (such as a 2x4 round the head ;-)) |
Re: mediaserv: on-demand video transcoding
Quote:
Code:
2007/10/25 08:49:43 18676 - NOTE! Can't exec "770-encode": No such file or directory at ./mediaserv line 265. HTH, Andrew |
Re: mediaserv: on-demand video transcoding
Great!! Thanks! Works now (locally). Can not connect with my n800 but i guess that's some network issue - i will look into it.
|
Re: mediaserv: on-demand video transcoding
The URL it reports on start-up may not work depending on your DNS setup. This should be listed as a known bug, although solving it generically might be tricky (I had some dodgy code before which pulled out the primary interface from the routing table and... well, don't ask).
Find the IP of your box using `ifconfig' and connect on port 8090 to that. If it's a fixed IP, you can modify the $ip variable in the app to report that as the URL for the service. |
Re: mediaserv: on-demand video transcoding
I had a similar problem with my 770 not connecting, even when using the IP.
I had to add an entry into my local hosts file with the ip and hostname of the mediaserv box before it would work. gaz |
Re: mediaserv: on-demand video transcoding
Thanks! The host file entry did it! This is great! Thanks so much!
|
Re: mediaserv: on-demand video transcoding
I haven't tried it yet, but I quickly looked at the code and it only looks for files with extension avi mpg ts mov wmv.
I'm going to add "vdr" to that list, but are you planning to do some special treatment for vdr recordings? (you know, interpreting the directory structure instead of the meaningless 001.vdr, 002.vdr, etc.) |
Re: mediaserv: on-demand video transcoding
I'd certainly love to treat VDR specially. v0.03 (not yet released) has MythTV and Freevo recording support:
http://www.bleb.org/software/maemo/mediaserv3.png Adding VDR support to the list is just as important: do you know the format (a patch or description would be very welcome), or know of somewhere documenting it? Failing that, an ls of an appropriate directory and the contents of any meta-data containing files would be good. |
Re: mediaserv: on-demand video transcoding
The format of the recording itself is mpeg-pes, mplayer/mencoder deals with it just fine (I'm still having problems transcoding with 770-encode.pl, but I manually transcoded with mencoder and played on the n800, but after adding vdr to the list of extensions I at least see the thumbnails just fine).
What's peculiar in vdr is the directory structure: each recording is in a subdirectory named name_of_the_recording/date_time.priority.rec, e.g. Donnie_Darko/2007-09-08.22.30.50.99.rec (a recording made the 8th of september 2007, at 22:30:50, with priority 99, the priority it's only for vdr internals). if episodes names are in use, there's an additional directory: The_Avengers/Mission_Highly_Improbable/2007-08-02.21.08.50.99.rec If it's a deleted recording, instead of .rec it will end in .del and shouldn't be shown in mediacenter Inside each recording there's a bunch of files. I'm copypasting from vdr.5 man page: Code:
AUDIO/VIDEO DATA Instead of having the user drill down to the directory and show all the file, you should just give the directory name (and eventually the episode name). This is an example info.vdr (as per the EPG DATA section above) Code:
C S28.2E-2-2045-6316 BBC FOUR |
Re: mediaserv: on-demand video transcoding
Quote:
When I do the same on the tablet, it will open with media player, that will say "format not recognized". If I cut and paste the url to mplayer, it will only show the first couple of frames. I have to go now, tomorrow I'll do more tests. |
Re: mediaserv: on-demand video transcoding
Blimey. They don't make it easy with VDR, do they?
|
Re: mediaserv: on-demand video transcoding
This is exactly what I've been looking for! Tried it and works great.
However there is one problem. Thumbnail pictures don't work and instead I get the default video.png for every video. I have tracked error to doImage function line rename("$tmpdir/00000001.jpg", "$DATA_DIR/data/$file.jpg"); If I change target file name for example to /tmp/pic.jpg it works, but /tmp/$file.jpg doesn't work. Another great feature would be ability take input from network stream instead of a file. Mencoder supports it but I just don't know how get the stream address through mediaserv and 770-encode. M3U file would be the easy way but mencoder doesn't support it. Maybe some hack which would extract the url from m3u would do the job. With stream input I could stream TV from vdr systen to n800 ;) |
Re: mediaserv: on-demand video transcoding
Goodnews! Finally got it working on my OS X box. Transcoding works great and the results are beautiful. Couldn't be any easier. :)
Thanks, aflegg! |
Re: mediaserv: on-demand video transcoding
Quote:
Quote:
Quote:
1) I want to be able to transcode-proxy RSS feeds. 2) I want to be able to access streaming video encoded in Freevo FXD files. Quote:
Thanks in advance, Andrew |
Re: mediaserv: on-demand video transcoding
Quote:
This is the remuxing script I found on the vdr mailing list (though there's a lot of room for improvements) Code:
|
Re: mediaserv: on-demand video transcoding
Quote:
No, seriously, it goes through all of this to avoid using a database (the filesystem is the database) and it works really well. |
Re: mediaserv: on-demand video transcoding
Quote:
I'm installing Leopard tomorrow, so I'll be running through the whole process again from scratch (and on a clean system) using more scientific methods. I should be able to work out a few tips for OS X users. |
Re: mediaserv: on-demand video transcoding
Hi Andrew, I tried sending this to you via mail, but it was bounced back. I assume that this is because of the server move...
I have been playing with latest version for a little while, and it is looking really nice. The MythTV meta data is displayed, and the thumbnails are being created now. The only things that I could see for improvement for the MythTV support are:
Kevin |
Re: mediaserv: on-demand video transcoding
Anyone happen to have the tarball somewhere? Nevermind. :D
|
Re: mediaserv: on-demand video transcoding
I've been using this for a day or so now and I seriously love it.
@mikkov: I also had problems with that rename line, I just replaced Code:
rename("$tmpdir/00000002.jpg", "$DATA_DIR/data/$file.jpg"); Code:
system("mv", "$tmpdir/00000002.jpg", "$DATA_DIR/data/$file.jpg"); This is *sort of* on topic: I've been doing a LOT of testing for video playback optimization on my n800, and this is the best setting I've come up with so far for 770-encode: Code:
n800 => { abitrate => 128, vbitrate => 1400, width => 400, height => 240, fps => 30 }, Code:
$options{"original-aspect"} ||= ''; If anyone else has done any research in this vein, please let me know what settings you're using. I'm a bit of a videophile so I'm always looking for ways to better encode my videos! :) Just for ease of reference, I also recommend checking this out for setting mplayer as your default video player in opera; it just makes the whole video viewing process smoother. I set my cache size to about 4000, which makes it take a little longer to start playing but leads to less jumpyness at the beginning and gives mencoder a bit of a headstart. Also, in the command line he uses for mplayer, "-vo x11 -ao sdl" needs to be removed because it causes problems, and "-fs" doesn't need to be in there, it does the same thing either way. Anyway, I'm eagerly looking forward to the next release! |
Re: mediaserv: on-demand video transcoding
Is the site just overloaded or is there some other location to get the install?
|
Re: mediaserv: on-demand video transcoding
The site was down this morning during a server move. For those in the UK, it'd've been when you should've been asleep... for elsewhere in the world - sorry.
It should now be backup. There's a beta of 0.03 at: http://www.bleb.org/software/maemo/m...rv-0.03.tar.gz Comments welcome. |
Re: mediaserv: on-demand video transcoding
Quote:
Quote:
Quote:
Quote:
|
Re: mediaserv: on-demand video transcoding
Beautiful software. Thanks
|
Re: mediaserv: on-demand video transcoding
Quote:
|
Re: mediaserv: on-demand video transcoding
Andrew
0.03 is really great. One thing which would be useful, certainly for us mythtv fans, would be to have the capability to have multiple folders, for tv recordings and videos. I know it's possible to have subfolders and with 0.02, I had it working by creating symlinks to the required folders. That approach breaks the metadata in 0.03 though, as the $path variable passed to mythname.pl has the subfolder passed though as part of it, rather than just the filename. Nothing to difficult to fix, but my very limited and basic perl skills are not up to making the change and passing it back to you. Good work though. Thanks Gary |
Re: mediaserv: on-demand video transcoding
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 >_>) |
Re: mediaserv: on-demand video transcoding
Good work Andrew. Works perfect.
A little bug, is that in Debian /sbin/ isn't in the PATH for default (as in maemo). So when searching for 'ifconfig' it shows a error that it doesn't found ifconfig. Regards. |
Re: mediaserv: on-demand video transcoding
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... :D All paths set, setup a $home path and started mediaserv.... Code:
C:\Documents and Settings\Administrator\Desktop\mediaserv>perl -w mediaserv 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::Daemon 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. :confused: 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 :D 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!] |
Re: mediaserv: on-demand video transcoding
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:
Again, all problem reports (and patches) welcome :-) |
Re: mediaserv: on-demand video transcoding
Initial thoughts: extremely badass.
That pretty much sums it up, actually. Well done! |
Re: mediaserv: on-demand video transcoding
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? |
Re: mediaserv: on-demand video transcoding
If I knew perl I'd send you patches instead of requests :rolleyes:, 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. |
Re: mediaserv: on-demand video transcoding
Quote:
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. |
Re: mediaserv: on-demand video transcoding
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 |
Re: mediaserv: on-demand video transcoding
Also, may I request that these additional extensions be added to the future version:
mkv mpeg rmvb |
Re: mediaserv: on-demand video transcoding
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. |
Re: mediaserv: on-demand video transcoding
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 }'`; Anyone else have any comments on this? |
All times are GMT. The time now is 14:02. |
vBulletin® Version 3.8.8