forked from SmartJog/python-mxf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmxfloader
41 lines (29 loc) · 781 Bytes
/
mxfloader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Small utility to parse MXF files and dump structure on standard output. """
VERSION = "@VERSION@"
from sjmxf.parser import mxf_kind
import optparse
def main(filename):
""" Parse MXF file. """
parser = mxf_kind(filename)
if not parser:
print "Could not parse", filename
return
parser.open()
parser.header_partition_parse()
parser.header_metadata_parse()
parser.header_dump()
parser.close()
return
if __name__ == "__main__":
PARSER = optparse.OptionParser(
version="%prog " + VERSION,
usage="%prog FILE",
option_list=[],
)
(_, ARGS) = PARSER.parse_args()
if len(ARGS) < 1:
PARSER.print_help()
else:
main(ARGS[0])