WikiStart » Historikk » Revisjon 7
« Forrige |
Revisjon 7/27
(diff)
| Neste »
Niels Petter Rasch-Olsen, 11.05.2006 13:44
= Welcome to pylibdv 0.0.1 =
Backgroundpylibdv 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."
So far the following functions are available:BR
Object:BR
DecoderBR
Methods:BR
parse_header()BR
decode_full_frame()BR
Data:BR
Different quality settings for decoding:BR
DV_QUALITY_BESTBR
DV_QUALITY_FASTESTBR
DV_QUALITY_COLORBR
DV_QUALITY_DCBR
DV_QUALITY_AC_1BR
DV_QUALITY_AC_2BR
DV_QUALITY_AC_MASKBR
Available color spaces for output buffers:BR
e_dv_color_rgbBR
e_dv_color_yuvBR
e_dv_color_bgr0BR
This project is ongoing and most functions will be wrapped by the end of the summer (depending on need).
Simple exampleimport pylibdv
decoder = pylibdv.Decoder(ignored=1, clamp_luma=1, clamp_chroma=1)
file = open("somedvfile.dv,"r")
framebuffer = file.read(120000) # Just enough to make sure
decoder.parse_header(framebuffer)
- Now we can get some information about the video
frame_size = decoder.frame_size
width = decoder.width
height = decoder.height
file.seek(0) #Back to start
framebuffer = file.read(frame_size)
rgb_buffer = decoder.decode_full_frame(framebuffer)
libdv 1.4BR
python >= 2.4 (testing.py won't work with 2.3, doctest will fail due to a bug in 2.3)BR
Enjoy! BR
[mailto:nielsr@ifi.uio.no Niels Petter Rasch-Olsen]
Oppdatert av Niels Petter Rasch-Olsen for over 18 år siden · 7 revisions