Prosjekt

Generell

Profil

WikiStart » Historikk » Revisjon 8

Revisjon 7 (Niels Petter Rasch-Olsen, 11.05.2006 13:44) → Revisjon 8/27 (Niels Petter Rasch-Olsen, 11.05.2006 14:18)

= Welcome to pylibdv 0.0.1 = 


 == Background == 
 pylibdv is a project for one of my university courses; [http://www.uio.no/studier/emner/matnat/ifi/INF5660/index-eng.xml INF5660 - Advanced problem solving with high level languages]. 

 pylibdv is a python wrapper for [http://libdv.sourceforge.net/ libdv].[[BR]] 
 From libdv home page: "libdv is a software codec for DV video, the encoding format used by most digital camcorders, typically those that support the IEEE 1394 Firewire or i.Link) interface. Libdv was developed according to the official standards for DV video: IEC 61834 and SMPTE 314M." 

 == Requirements == 
 libdv 1.4 (works with debian package 0.104-2 from debian reository)[[BR]] 
 python >= 2.4 (testing.py won't work with 2.3, doctest will fail due to a bug in 2.3)[[BR]] 
 gcc[[BR]] 

 == Known bugs == 
 libdv seg-faults on some versions of the libdv library. There seems to be a bug in the asm-optimization, so a quick work-around if this occurs is to turn off asm-optimization. 

 == Progress == 
 So far the following is functions are available:[[BR]] 
 Object:[[BR]] 
 Decoder[[BR]] 

 pylibdv:[[BR]] 
   Constants:[[BR]] 
     Methods:[[BR]] 
 parse_header()[[BR]] 
 decode_full_frame()[[BR]] 

 Data:[[BR]] 
 Different quality settings for decoding:[[BR]] 
 DV_QUALITY_BEST[[BR]] 
     
 DV_QUALITY_FASTEST[[BR]] 
     
 DV_QUALITY_COLOR[[BR]] 
     
 DV_QUALITY_DC[[BR]] 
     
 DV_QUALITY_AC_1[[BR]] 
     
 DV_QUALITY_AC_2[[BR]] 
     
 DV_QUALITY_AC_MASK[[BR]] 
     

 Available color spaces for output buffers:[[BR]] 
 e_dv_color_rgb[[BR]] 
     
 e_dv_color_yuv[[BR]] 
     
 e_dv_color_bgr0[[BR]] 
   Object:[[BR]] 
     Decoder[[BR]] 
       Methods:[[BR]] 
         parse_header()[[BR]] 
         decode_full_frame()[[BR]] 
       Data:[[BR]] 
         frame_size (read only)[[BR]] 
         width (read only)[[BR]] 
         length (read only)[[BR]] 
         quality (read & write)[[BR]] 


 




 This project is ongoing and most functions will be wrapped by the end of the summer (depending on need). 



 

 == Simple example == 
 {{{ 
 import pylibdv 

 decoder = pylibdv.Decoder(ignored=1, clamp_luma=1, clamp_chroma=1)  

 file = open("somedvfile.dv,"r")[[BR]] open("somedvfile.dv,"r") 
 framebuffer = file.read(120000) # Just enough to make sure[[BR]] sure 

 decoder.parse_header(framebuffer)[[BR]] decoder.parse_header(framebuffer) 

 # Now we can get some information about the video[[BR]] video 
 frame_size = decoder.frame_size[[BR]] decoder.frame_size 
 width = decoder.width[[BR]] decoder.width 
 height = decoder.height[[BR]] decoder.height 

 file.seek(0) #Back to start[[BR]] start 
 framebuffer = file.read(frame_size)[[BR]] file.read(frame_size) 
 rgb_buffer = decoder.decode_full_frame(framebuffer)[[BR]] decoder.decode_full_frame(framebuffer) 



 == Requirements == 
 #Now the rgb buffer can be drawn libdv 1.4[[BR]] 
 python >= 2.4 (testing.py won't work with 2.3, doctest will fail due to screen, check out gtk package[[BR]] 
 }}} 


 a bug in 2.3)[[BR]] 



 Enjoy! [[BR]] 
 [mailto:nielsr@ifi.uio.no Niels Petter Rasch-Olsen]