diff --git a/README b/README index db2d369..620fb5e 100644 --- a/README +++ b/README @@ -2,11 +2,9 @@ oxgt-tools Tools oxframe - get frame from movie, image can be resized by adding --width or --height + C version in its own repos at http://code.0x2620.org/oxframe/ now oxtimeline create timeline from video - oxinfo - output information about video, output can in xml, json or cfg format oxposter render 0xdb poster oxicon @@ -22,6 +20,3 @@ Python API timeline = oxgst.Timeline(videoFile) timeline.extract(timeline_prefix, width, height) - info = oxgst.Info(videoFile) - info.metadata - {videoCodec:..} diff --git a/bin/oxframe b/bin/oxframe deleted file mode 100755 index 8fe0d51..0000000 --- a/bin/oxframe +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# vi:si:et:sw=4:sts=4:ts=4 -# GPL 2008 -import gobject -gobject.threads_init() - -import os -import sys -from optparse import OptionParser - -import pygst -pygst.require("0.10") -import gst -import Image - -root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') -if os.path.exists(os.path.join(root, 'oxgst')): - sys.path.insert(0, root) - -from oxgst import Video - - -if __name__ == '__main__': - width = None - height = None - size = None - parser = OptionParser() - parser.add_option('-x', '--width', dest='width', help='scale image to given width') - parser.add_option('-y', '--height', dest='height', help='scale image to given height') - parser.add_option('-p', '--pos', dest='pos', help='frame position in seconds, float') - parser.add_option('-i', '--input', dest='input', help='video input') - parser.add_option('-o', '--output', dest='output', help='path to save frame to, jpg, png supported') - (opts, args) = parser.parse_args() - if None in (opts.input, opts.output, opts.pos): - parser.print_help() - sys.exit() - if opts.width: - width = int(opts.width) - if opts.height: - height = int(opts.height) - video = Video(opts.input) - timestamp = int(float(opts.pos) * gst.SECOND) - - frame = video.frame(timestamp) - if frame: - if width: - height = int(float(frame.size[1])/frame.size[0] * width) - height = height + height%2 - size = (width, height) - elif height: - width = int(float(frame.size[0])/frame.size[1] * height) - width = width + width%2 - size = (width, height) - if size: - frame = frame.resize(size, Image.ANTIALIAS) - frame.save(opts.output) - diff --git a/bin/oxinfo b/bin/oxinfo deleted file mode 100755 index a9981e9..0000000 --- a/bin/oxinfo +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# vi:si:et:sw=4:sts=4:ts=4 -# GPL 2009 - -import os -import sys -import Image -from optparse import OptionParser -import xml.etree.ElementTree as ET - -root = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') -if os.path.exists(os.path.join(root, 'oxgst')): - sys.path.insert(0, root) - -from oxgst import Info - -if __name__ == "__main__": - parser = OptionParser() - parser.add_option('-f', '--format', dest='format', help='output format: cfg, json, xml default: cfg') - (opts, args) = parser.parse_args() - - if not args: - parser.print_help() - sys.exit(1) - - inputFile = args[0] - if not os.path.exists(inputFile): - sys.exit(1) - info = Info(inputFile) - if opts.format == 'xml': - xml = ET.Element("gstinfo") - el = ET.SubElement(xml, "path") - el.text = inputFile - for key in sorted(info): - el = ET.SubElement(xml, key) - el.text = unicode(info[key]) - print u'\n' + ET.tostring(xml).replace('><', '>\n <').replace(' height: - width = int(int(opts.size) * (float(width) / height)) - height = int(opts.size) - width = width - width % 2 - ox = abs(height - width) / 2 - oy = 0 - else: - height = int(int(opts.size) * (float(height) / width)) - width = int(opts.size) - height = height - height % 2 - ox = 0 - oy = abs(height - width) / 2 - frame = frame.resize((width, height), Image.ANTIALIAS) - - frame = frame.crop((ox, oy, int(opts.size) + ox, oy + int(opts.size))) - frame.save(opts.output) -