Prosjekt

Generell

Profil

WikiStart » Historikk » Versjon 7

Niels Petter Rasch-Olsen, 11.05.2006 13:44

1 2 Niels Petter Rasch-Olsen
= Welcome to pylibdv 0.0.1 =
2 1
3 3 Niels Petter Rasch-Olsen
4
== Background ==
5 6 Niels Petter Rasch-Olsen
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].
6 3 Niels Petter Rasch-Olsen
7 1
pylibdv is a python wrapper for [http://libdv.sourceforge.net/ libdv].[[BR]]
8
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."
9 6 Niels Petter Rasch-Olsen
10
== Progress ==
11
So far the following functions are available:[[BR]]
12
Object:[[BR]]
13
Decoder[[BR]]
14
15
Methods:[[BR]]
16 7 Niels Petter Rasch-Olsen
parse_header()[[BR]]
17
decode_full_frame()[[BR]]
18 6 Niels Petter Rasch-Olsen
19
Data:[[BR]]
20
Different quality settings for decoding:[[BR]]
21
DV_QUALITY_BEST[[BR]]
22
DV_QUALITY_FASTEST[[BR]]
23
DV_QUALITY_COLOR[[BR]]
24
DV_QUALITY_DC[[BR]]
25
DV_QUALITY_AC_1[[BR]]
26
DV_QUALITY_AC_2[[BR]]
27
DV_QUALITY_AC_MASK[[BR]]
28
29
Available color spaces for output buffers:[[BR]]
30
e_dv_color_rgb[[BR]]
31
e_dv_color_yuv[[BR]]
32
e_dv_color_bgr0[[BR]]
33
34
35
36 1
37
This project is ongoing and most functions will be wrapped by the end of the summer (depending on need).
38 7 Niels Petter Rasch-Olsen
39
== Simple example ==
40
import pylibdv
41
42
decoder = pylibdv.Decoder(ignored=1, clamp_luma=1, clamp_chroma=1) 
43
44
file = open("somedvfile.dv,"r")
45
framebuffer = file.read(120000) # Just enough to make sure
46
47
decoder.parse_header(framebuffer)
48
49
# Now we can get some information about the video
50
frame_size = decoder.frame_size
51
width = decoder.width
52
height = decoder.height
53
54
file.seek(0) #Back to start
55
framebuffer = file.read(frame_size)
56
rgb_buffer = decoder.decode_full_frame(framebuffer)
57
58
59 1
60 4 Niels Petter Rasch-Olsen
== Requirements ==
61
libdv 1.4[[BR]]
62
python >= 2.4 (testing.py won't work with 2.3, doctest will fail due to a bug in 2.3)[[BR]]
63 1
64
65
66
Enjoy! [[BR]]
67 4 Niels Petter Rasch-Olsen
[mailto:nielsr@ifi.uio.no Niels Petter Rasch-Olsen]