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-24 22:16

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.

zeez 2007-10-24 22:48

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 !

aflegg 2007-10-25 08:35

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 ;-))

aflegg 2007-10-25 09:17

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by zeez (Post 86691)
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)

For reference: it turned out 770-encode wasn't on the path. /tmp/mediaserv.log contained the key line:

Code:

2007/10/25 08:49:43 18676 - NOTE! Can't exec "770-encode": No such file or directory at ./mediaserv line 265.
This means that 770-encode isn't on the path. The solution is to either add it to your PATH or modify the $encoder variable at the top of the script to contain the full filename of where you have 770-encode installed.

HTH,

Andrew

zeez 2007-10-25 09:33

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.

aflegg 2007-10-25 09:41

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.

gazza_d 2007-10-25 09:51

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

zeez 2007-10-25 12:13

Re: mediaserv: on-demand video transcoding
 
Thanks! The host file entry did it! This is great! Thanks so much!

luca 2007-10-25 15:29

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.)

aflegg 2007-10-25 15:42

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.

luca 2007-10-25 17:57

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
      The files 001.vdr...255.vdr are the actual recorded MPEG data files. In
      order  to  keep  the  size of an individual file below a given limit, a
      recording is split into several files. The contents of these  files  is
      Packetized  Elementary  Stream  (PES)  and contains ES packets with ids
      0xE0...0xEF for video (only one of these may actually occur in a file),
      0xC0...0xDF  for audio 1...32 (up to 32 audio tracks may occur).  Dolby
      Digital data is stored in packets with ids 0xBD  ("Private  Stream  1")
      and substream ids 0x80...0x87.

  INDEX
      The  file  index.vdr (if present in a recording directory) contains the
      (binary)  index  data  into  each  of  the  the  recording  files
      001.vdr...255.vdr.  It  is  used during replay to determine the current
      position within the recording, and to implement skipping and fast  for‐
      ward/back  functions.  See  the definition of the cIndexFile class for
      details about the actual contents of this file.
  INFO
      The file info.vdr (if present in  a  recording  directory)  contains  a
      description  of  the  recording, derived from the EPG data at recording
      time (if such data was available). The Aux field of  the  corresponding
      timer  (if given) is copied into this file, using the '@' tag.  This is
      a plain ASCII file and contains tagged lines like  the  EPG  DATA  file
      (see  the  description  of  the epg.data file). Note that the lowercase
      tags ('c' and 'e') will not appear in an info.vdr file.  Lines  tagged
      with  '#'  are ignored and can be used by external tools to store arbi‐
      trary information.

  RESUME
      The file resume.vdr (if present in a recording directory) contains  the
      position  within  the recording where the last replay session left off.
      The data is a four byte (binary) integer value and  defines  an  offset
      into the file index.vdr.

  MARKS
      The  file  marks.vdr (if present in a recording directory) contains the
      editing marks defined for this recording.  Each line contains the defi‐
      nition of one mark in the following format: (omitted)

  EPG DATA
      The  file  epg.data contains the EPG data in an easily parsable format.
      The first character of each line defines what kind of  data  this  line
      contains.

      The following tag characters are defined:
 
      C  <channel id> <channel name>
      E  <event id> <start time> <duration> <table id> <version>
      T  <title>
      S  <short text>
      D  <description>
      X  <stream> <type> <language> <descr>
      V  <vps time>
      e
      c

basically you only need the [0-9][0-9][0-9].vdr files and info.vdr to extract the information.
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
E 41995 1186081800 3000 0 FF
T The Avengers
S Mission Highly Improbable
D Steed and Emma investigate a professor's ability to make things disappear.
X 2 03 eng
X 2 03 NAR


luca 2007-10-25 18:24

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by luca (Post 86980)
I'm still having problems transcoding with 770-encode.pl

mmh, I changed the setting to 'best', and using my laptop, I can see the transcoded video just fine (by clicking on it it will open the mplayer plugin).
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.

aflegg 2007-10-25 18:25

Re: mediaserv: on-demand video transcoding
 
Blimey. They don't make it easy with VDR, do they?

mikkov 2007-10-25 19:11

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 ;)

GeneralAntilles 2007-10-25 19:55

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!

aflegg 2007-10-25 22:17

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by mikkov (Post 87018)
This is exactly what I've been looking for! Tried it and works great.

Glad you like it, and thanks for the feedback!

Quote:

Originally Posted by mikkov (Post 87018)
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");

This should be fixed in the next version, v0.03 which I'm hoping to release tomorrow. At the moment bleb.org's down whilst the server moves from London to Manchester, but assuming I know my /etc/network/interfaces from my /etc/resolv.conf, it should come back up tomorrow morning as I get out of bed with no problems whatsoever (famous last words).

Quote:

Originally Posted by mikkov (Post 87018)
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.

It's certainly planned to be able to support URL import, for two reasons:

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:

Originally Posted by GeneralAntilles (Post 87039)
Goodnews! Finally got it working on my OS X box. Transcoding works great and the results are beautiful. Couldn't be any easier. :)

Excellent, since I don't have a Mac anymore, I wasn't sure it would work. What did you have to do to get it working? Is there anything I can add to the README to make it easier for others in future?

Thanks in advance,

Andrew

luca 2007-10-25 22:18

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by mikkov (Post 87018)
With stream input I could stream TV from vdr systen to n800 ;)

You can do that with the streamdev-server plugin: the cvs version can use an external remuxer, so that, e.g., pointing mplayer on the tablet at http://your.vdr.machine:3000/Extern/1 will stream the first channel in channels.conf (http://your.vdr.machine:3000/Extern/channels.htm in a browser will give you a list of channels).
This is the remuxing script I found on the vdr mailing list (though there's a lot of room for improvements)

Code:


#!/bin/bash

IN=-
OUT=/tmp/out

rm -f $OUT.avi /tmp/$OUT.log
/usr/bin/mkfifo $OUT.avi

cat $OUT.avi &
exec /usr/bin/mencoder "$IN" -cache 1024 -srate 44100 -oac mp3lame -lameopts vbr=0:br=128 -af volnorm -ovc lavc \
-lavcopts vcodec=mpeg4:vbitrate=600 -vf-add scale=512:288 -ffourcc DIVX -noidx -o $OUT.avi &>/dev/null


luca 2007-10-25 22:27

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by aflegg (Post 86993)
Blimey. They don't make it easy with VDR, do they?

define "easy" ;)
No, seriously, it goes through all of this to avoid using a database (the filesystem is the database) and it works really well.

GeneralAntilles 2007-10-25 22:29

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by aflegg (Post 87129)
Excellent, since I don't have a Mac anymore, I wasn't sure it would work. What did you have to do to get it working? Is there anything I can add to the README to make it easier for others in future?

That, I couldn't really tell you. ;)

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.

kbarter 2007-10-26 00:55

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:
  • I have some subdirectories under my mythtv directory, and mediaserv tries to look them up in the database. The message returned by mythname.pl is /media/mythtv/n800 is not in the database. Perhaps a check for this message, or a check to make sure the object is a file before looking up the info would work.
  • My only other concern at this point is that I have 300+ recordings for mythtv (and it is growing). I know that this is not large by many peoples standards. Perhaps a future enhancement could be some sort of paging. That is only display 20 or 50 or whatever videos per page.
Great work!

Kevin

zerojay 2007-10-26 03:16

Re: mediaserv: on-demand video transcoding
 
Anyone happen to have the tarball somewhere? Nevermind. :D

rm_you 2007-10-26 05:15

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");
with
Code:

system("mv", "$tmpdir/00000002.jpg", "$DATA_DIR/data/$file.jpg");
and it worked great. Apparently this is because my home directory and my tmp directory are on different physical drives.

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 },
I also include these lines right after options are defined:
Code:

$options{"original-aspect"} ||= '';
$options{"experimental"} ||= '';

With those set, it no longer automatically crops my video (very annoying for movies with subtitles >_>) and it may just be me but the experimental filters seem to work nicely. A note on these fairly high settings, however, is that mencoder is pretty much barely keeping up with the encoding on my Athlon 3500+ with nothing else running (I don't even run Xorg on that machine) and running almost anything else will make the video lag. It does work very nicely for non-realtime encoding though, if you have a slower processor!
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!

mplawner 2007-10-26 07:48

Re: mediaserv: on-demand video transcoding
 
Is the site just overloaded or is there some other location to get the install?

aflegg 2007-10-26 13:37

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.

aflegg 2007-10-26 13:44

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by kbarter (Post 87174)
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...

Indeed.

Quote:

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.
Excellent.

Quote:

I have some subdirectories under my mythtv directory, and mediaserv tries to look them up in the database. The message returned by mythname.pl is /media/mythtv/n800 is not in the database. Perhaps a check for this message, or a check to make sure the object is a file before looking up the info would work.
It should now check that it's a file in the latest beta.

Quote:

My only other concern at this point is that I have 300+ recordings for mythtv (and it is growing). I know that this is not large by many peoples standards. Perhaps a future enhancement could be some sort of paging. That is only display 20 or 50 or whatever videos per page.
Good idea. Added to the "KNOWN BUGS".

mplawner 2007-10-26 14:19

Re: mediaserv: on-demand video transcoding
 
Beautiful software. Thanks

aflegg 2007-10-26 15:34

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by mplawner (Post 87349)
Beautiful software. Thanks

Thanks, such feedback is much appreciated :-)

gazza_d 2007-10-26 16:10

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

rm_you 2007-10-26 16:49

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 >_>)

yerga 2007-10-26 18:43

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.

yabbas 2007-10-27 00:24

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
'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::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!]

aflegg 2007-10-27 14:30

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:
  • 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 :-)

aleksandyr 2007-10-27 17:20

Re: mediaserv: on-demand video transcoding
 
Initial thoughts: extremely badass.

That pretty much sums it up, actually. Well done!

mplawner 2007-10-27 18:30

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?

luca 2007-10-27 18:40

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.

luca 2007-10-27 19:26

Re: mediaserv: on-demand video transcoding
 
Quote:

Originally Posted by luca (Post 87815)
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.

mplawner 2007-10-27 19:47

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

### 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


mplawner 2007-10-27 20:00

Re: mediaserv: on-demand video transcoding
 
Also, may I request that these additional extensions be added to the future version:
mkv mpeg rmvb

aflegg 2007-10-27 22:09

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.

rm_you 2007-10-27 22:23

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 }'`;
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?


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

vBulletin® Version 3.8.8