pranjalpansuriya / pyramiding Goto Github PK
View Code? Open in Web Editor NEWThis project forked from regular/pyramiding
nested media container framework for python multimedia apps
This project forked from regular/pyramiding
nested media container framework for python multimedia apps
Q: What do zip files and mpeg4 files have in common? A: Both are containers. In the first case for more files, in the latter case for one or more video and or audio streams. A video stream again is a container -- it contains still images. A file in the zip file most likely also is a container for something else. In general, most file formats can be considered containers for subparts which in turn also are containers. This is a hierarchical recursive structure much like a directory tree. pyramiding generalises traversal and read access of such a tree of containers, no matter if it is a directory tree or some structure inside a file. pyramiding consists of several python modules that can be seen as 'drivers' for a specific file format. Such a driver is called 'Archive'. Archives know how to iterate over the contents of a file they support, provide data streams (file-like objects) for each item they contain and meta data about those items. Data stream and meta data are combined by 'Resources'. An Archive contains Resourcees, a Resource is the input data stream of an Archive instance. Archives read a Resource to enumerate its children. Archives are used by Resources internally. The class Resource is the only visible class outside pyrmaiding. pyramiding will use lazy evaluation and caching to free the developer from efficiency concerns. from pyRamiding import Resource try: data = Resource(file("videos.tar")) name = data["info.ini"]["section1"]["name"].read() # smae as data.find("info.ini/section1/name").as_string() image_resource, location = data.find("icon.jpg/image"), data.find("icon.jpg/exif/geo-location") width, height = image_resource.details.width, image_resource.details.height rgb_data = image_resource.read() for version in data.find("versions"): if version["video"].details.width >= desired_width: break print "Selected video file %(name)s, size: %(width)d x %(height)d pixels" % version["video"].details last_frame_data = version["video"][version["video"].details.frame_count - 1].read() except ResourceNotFound, e: print e.path, "does not exist" As a first milestone, the following Archives will be implemented (probably even in this order) - Thank You..! - ini - tar - json, js - png - jpg, jpeg - mpg, mpeg, mp4 - zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.