Adam Charrett wrote:
On Thu, 2008-03-13 at 18:27 +0000, John Molohan wrote:
  
Adam Charrett wrote:
    
On Tue, 2008-03-11 at 15:15 +0100, Duncan Webb wrote:
  
      
Rob Shortt said the following, on 11.03.2008 14:46:
    
        
Hi Adam,

Adam Charrett wrote:
  
      
          
Right annoyingly I thought pygame could do this, although it appears it
will only be able to do it from the next release (1.8).
    
        
            
I ran into that also.


  
      
          
So my question is what is the best way to take a pygame.Surface and save
it as an 8bit paletised/indexed PNG?

It needs to be an index PNG as Vlc won't load anything else for its logo
filter which I am going to use to display an OSD.

Any help would be much appreciated, I've had a look a kaa.imlib2 but its
not clear to me whether I can specify the format of the PNG. I haven't had
a look at PIL yet, but I was hoping to keep the dependencies the same as
freevo 1.
    
        
            
My first thought was PIL, but kaa.imlib2 should work fine as well.  Take
a look at some of the mevas code in the kaa SVN.  You'll likely need to
use the pygame Surface fromstring()/whatever and create in imlib2 or PIL
image with that data (both libraries have that ability).  I think you
can specify the image format in imlib2, or create it as raw and then
convert it to the PNG you need.
  
      
          
I had a look at the imlib2 C code and it is not clear how to specify how
to set the format to 8 bit, I noticed that imlib2 uses lib png for
loading an image and I guess saving one too.

Duncan
    
        
Thanks all, a quick look at the source code of imlib2 seemed to suggest
to me that it was hardcoded to ARGB for PNG, but PIL worked fine.

Unfortunately it seems to be a wasted learning experience as Vlc logo
filter works fine when used as a video filter, but you can't move/change
it. As a sub filter, which can be moved/changed, the colours are
completely wrong, I assume something todo with conversion to a YUV
palettised surface in Vlc. 
  
      
Might still be an idea to use some of VLC's functionality for say a 
freevo logo and text with the name of the program/recording being 
watched to appear. From what I recall reading up on vlc it would be 
possible to have these display for x seconds at the start and then 
disappear.
    

Yep, got that side of thing working, as a fallback if not using X, works
nicely using Vlc marquee plugin.
  
Great! I'll keep an eye out for a patch :)
  
Oh well, next step an X only solution for graphics OSD not what I
wanted, but gstreamer is not mature enough yet to include dvb subtitles.

Thanks again

Adam
      
By chance I happened to hit F6 on the keyboard while playing with dvb in 
xine and got a very nice looking overlay with an epg of what's on now 
and what's on next (taken from the stream). Is there no ability to use 
this overlay with custom text? Freevo could display a similar epg from 
xmltv for analogue or ivtv users and I'm sure a bunch of other stuff. 
Also hitting F1 started recording the show so that would get a recent 
poster's 'red button' functionality, sorry I'm going off topic here.
    

The OSD layer might be usable from outside Xine by subverting its
ability to display menus, like Oxine.
  
Maybe Richard is the man for that?
As for the red button functionality, he was refer to MHEG5 support, ie
the digital equivalent of teletext. I have been intending the add the
instant record functionality, just not got round-to-it yet :-)

Cheers

Adam

  
Ah right, I wasn't aware of that.

John
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to