Hello Duncan and Wout,
I fixed the issue where you can have ITEMS which may not be a tuple
(like in the case of web radio). So Duncan with the new patch you
should be able to use webserver without any modifications and
(hopefully) no crashes :-). Before adding child resources to twisted I
check to make sure the each item is a tuple. If you think users may
use lists, then we need to add that check as well. But I think we are
good to go for now.
As for images, I modified the code to scale images that are larger
than 800x600 to 200x200 (maintaining aspect ratio of course). Does
that answer your queries Wout? May be we can make the 800x600 value a
config variable. Or you guys decide what would be a proper value. This
change will speed up image downloads. Oh I also made sure that when
you click on the links the original image files are opened.
Yes I see that TV recordings work now. Excellent!
Regards,
Chandan
On 12/28/06, Duncan Webb <[EMAIL PROTECTED]> wrote:
> Chandan Pitta wrote:
> > On 12/28/06, Duncan Webb <[EMAIL PROTECTED]> wrote:
> >> Chandan Pitta wrote:
> >>> Hello,
> >>>
> >>> I was unable to attach files in the tracker so I am replying to this
> >>> email with attachments. I made some changes to the webserver so that
> >>> it can make use of child resources instead of creating several links
> >>> in /var/cache/freevo. Not that I have anything against having all the
> >>> links but it is easier making use of available features of twisted.
> >>>
> >>> In addition I added code to display .jpg file if a fxd file is missing
> >>> and the .jpg file matches with the directory or file because that is
> >>> how Freevo was doing it. I have some folders where I just have .jpg
> >>> files with the name matching the movie file with no fxd and freevo
> >>> displays the image but the webserver was not. With the modifications I
> >>> made it is much closer to what Freevo does. You might want to add more
> >>> formats (.png etc) if you like or I can add them if you tell me which
> >>> formats to add.
> >>>
> >>> Finally I changed the way the fxd file is parsed to display
> >>> "cover-img", since I am always getting index out of bounds exceptions
> >>> for
> >>>
> >>> cover = str(b.attrs.values()[0])
> >>>
> >>> although I am using the fxd file as given in the examples. Freevo is
> >>> able to display it fine on my TV. With the code changes I made, I am
> >>> not getting any more exceptions.
> >>>
> >>> Please review the code and merge it if you like.
> >> Great stuff Chandan, this fixes one of the main Freevo-1.7 bugs.
> >>
> >> There is one new problem:
> >>> + for (item, dir_str) in config.AUDIO_ITEMS:
> >>> + root.putChild(dir_str.replace("/", "_"), static.File(dir_str))
> >> causes a crash when the web radio has been activated, web radio is a
> >> single fxd file and goes into AUDIO_ITEMS.
> >
> > I have never used the web radio plugin. How do I use it? I usually
> > have a fxd file that lists the web links like so
> >
> > <?xml version="1.0" ?>
> > <freevo>
> > <container title="Web Radio" type="webradio">
> > <audio title="Bollywood music">
> > <url>http://www.bollywood.mu/pls.php?filename=listen.pls</url>
> > <info>
> > <description>Live bollywood music</description>
> > </info>
> > </audio>
> >
> > <audio title="PulsRadio - www.pulsradio.com - Quality 64 kbps AAC+">
> > <url>http://213.251.190.160:6665</url>
> > <info>
> > <description>Non-Stop Dance Music</description>
> > </info>
> > </audio>
> >
> > <audio title="S K Y . F M">
> > <url>http://64.236.34.4:80/stream/1014</url>
> > <info>
> > <description>Top Hits Music - who cares about the chart order,
> > less rap and more hits!</description>
> > </info>
> > </audio>
> >
> > </container>
> > </freevo>
> >
> > and I add it to local_conf.py as
> >
> > AUDIO_ITEMS = [
> > ('Web streams',
> > '/home/chandanp/playlists/webaudios.fxd')
>
> It groups types together, may be in the wiki.
>
> <?xml version="1.0" ?>
> <freevo>
> <container title="Web Radio 2" type="webradio">
> <container title="News and Talk">
> <audio title="BBC World Service">
>
> <url>rtsp://rmlivev8.bbc.net.uk/farm/*/ev7/live24/worldservice/liveinfent.ra</url>
> </audio>
> <audio title="Air America Radio">
> <url>mms://ccdig.liquidviewer.com/KPOJ</url>
> <info>Alternate Air America Stream via KPOJ</info>
> </audio>
> ...
> </audio>
> </container>
>
> <info>
> <description>Radio stations on the net</description>
> </info>
> </container>
> </freevo>
>
> AUDIO_ITEMS = [
> ('Music Collection', '/freevo/music'),
> '/freevo/fxdfiles/webradio.fxd',
> ]
>
> > ]
> >
> > I did not have any crashes. The item just did not show up on the web
> > page. Am I missing any specific information? Let me know and I will
> > try to find a fix.
>
> The title comes from the fxd file.
> >
> >
> >> What is a bit of a problem is large image files, 7.2MegaPixel cameras
> >> give an image typically 3072x2304 which is approximately 3MB, the
> >> directory takes ages to display the images when there are more than a few.
> >>
> >> What I have suggested to Wout is that we create a small image, and use
> >> this as the img src.
> >>
> >> The code to do this is (about line 510):
> >> small_image_path = self.cache_dir + filepath.replace("/", "_")
> >> if not os.path.exists(small_image_path):
> >> size = (info['width'], info['height'])
> >> new_size = self.resize_image(filepath, size)
> >> image = imlib2.open(filepath)
> >> new_image = image.scale(new_size)
> >> new_image.save(small_image_path)
> >>
> >> If you or Wout would like to do this it would be great.
> >>
> >
> > I think it is a good idea, but this has to be done only for
> > media=images. I will take a look at it.
>
> Only images
>
> >> I will need to do the same when "freevo cache" is run, but this needs to
> >> be done first.
> >>
> >>> However I could not solve one problem, I am unable to click on
> >>> recorded TV programs from webpage. They are not active links. Is
> >>> anyone facing the same problem?
> >> These didn't work in the original patch either.
> >>
> >
> > Hmm, one more item in my TODO list then.
>
> TV is mostly fixed in svn, patch from wout sorted it out and I just
> fixed a Unicode problem with the pop-ups.
>
> >
> >>> Another question I always wanted to ask was, where do all the images
> >>> for recorded TV go? There are no jpg files in my recording directory,
> >>> but in Freevo I see the cover image. The .fxd files do not have
> >>> cover-img tag. It would be nice to show them in the webserver.
> >> The go into the overlay directory as raw files. From util/videothumb.py:
> >> if image.mode == 'BGRA':
> >> image.mode = 'RGBA'
> >> if imagefile.endswith('.raw.tmp'):
> >> f = vfs.open(imagefile[:-4], 'w')
> >> data = (str(image.get_raw_data(format=image.mode)), \
> >> image.size, image.mode)
> >> f.write('FRI%s%s%5s' % (chr(image.width), \
> >> chr(image.height), image.mode))
> >> f.write(data[0])
> >> f.close()
> >> os.unlink(imagefile)
> >>
> >> They get decode in util/fileops.py:
> >> def read_thumbnail(filename):
> >> """
> >> return image cached inside filename
> >> """
> >> f = open(filename)
> >> header = f.read(10)
> >> if not header[:3] == 'FRI':
> >> return read_pickle(filename)
> >> data = f.read(), (ord(header[3]), ord(header[4])),\
> >> header[5:].strip(' ')
> >> f.close()
> >> return data
> >>
> >> image = pygame.image.fromstring(\
> >> str(url.get_raw_data(format=url.mode)), url.size, url.mode)
> >>
> >
> > Got it. But is there a specific reason to have them as raw images
> > stored somewhere? I mean if freevo could make thumbnails in the same
> > folder with the same name as the file and add it to .fxd that will be
> > much useful, for example if you plan on moving your recordings. You
> > see I usually record my favorites to a smaller 80 GB drive and after
> > watching them if I like a program I move it to a bigger 320 GB drive
> > and in the process I loose the thumbnails and I have to create them
> > manually.
>
> There's a configuration option per directory, auto build thumbnails, it
> is inherited from the parent directory. 'E' the directory and choose
> configure directory. Very useful.
>
> Don't know the history of the decision, or why they have a freevo
> format. May be to do with pygame.
>
> Duncan
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Freevo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freevo-devel
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel