Latest News

Follow the latest news on OpenShot Video Editor!


,

Since starting this journey, I have had the pleasure to meet many people inside the Linux video editing community. The PiTiVi project (lead by Edward Hervey) has contacted me about joining their project. PiTiVi is a Python, Gstreamer, and Gnonlin based non-linear video editing project.

I have also been in contact with many members of the Cinelerra project (which is arguably the largest and most complete FOSS Linux-based video editor). The Cinelerra community is designing version 3 (named Lumiera), and they are actively collecting ideas. I have been keeping track of the best ideas. Don't worry, I'll give credit to them for any ideas I use. =) Thanks guys.

Recently, I have been contacted by the creator of a brand new non-linear video editing project, called the Saya Video Editor. I'm not sure what the term Saya means (Wikipedia claims that it is a Japanese pop singer). Let's hope that's not what it stands for. =) They are using a different multimedia backend than all the previous editors I mentioned, so good luck to them.

I'm not sure where my project will end up in this community. There are many smart and creative people, and a huge community of users that really want a good video editor.

One thing is for sure, Linux will have a good video editor soon:

,

I have completed my first real Python program, which is a video / audio file inspector (and player). Simply download the source code, and run the "Inspector.py" script to start the program.

Click here to download the source code.

Here is a screen shot of my program:


This program has accomplished 2 important things for me. 1) It has been a great learning experience, which has given me lots of confidence. 2) It's going to provide code that I can use in my real program: a much more complicated non-linear video editor for Linux.

,

Ever wanted to export a frame of video to an image file (such as a PNG file)? Well, here's how to do it with gstreamer. These examples use the gstreamer command line syntax (gst-launch):

Export a DV file frame to a PNG file:
gst-launch filesrc location=/home/jonathan/capture003.dv ! dvdemux name=demux ! dvdec ! ffmpegcolorspace ! pngenc ! filesink location=foo.png

Export an MPEG file frame to a PNG file:
gst-launch filesrc location=/home/jonathan/Cow.mpg ! mpegdemux ! mpeg2dec ! ffmpegcolorspace ! pngenc ! filesink location=foo.png

My next task to figure out how to create this same pipeline via Python, so I can do this programmaticly. I'll post a Python example once I figure it out.

UPDATE: I've finally figured out how to accomplish this in Python with an even more flexible pipeline than the examples above... Click Here to read how.

,

I've spent the past few weeks putting together a working Python example, which allows a user to select a media file (audio or video) and display all the various information I can find (such as height, width, duration, position, frames per second, codec, etc...). One of my blog readers informed me of a module (which is already written and included in the Python bindings for Gstreamer) called Discoverer. This is far cleaner than the code I was writing, and super useful.

Give this example code a try in your favorite Python IDE. Be sure to pass 1 argument to the script (the file path of a media file):

#!/usr/bin/env python
# gst-python
# Copyright (C) 2006 Andy Wingo <wingo at pobox.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.


import os
import sys

import pygtk
pygtk.require('2.0')
import gobject
gobject.threads_init()
import pygst
pygst.require('0.10')
import gst
from gst.extend import discoverer

def fail(path):
print "error: %r does not appear to be a media file" % path
sys.exit(1)

def succeed(d):
def pp(prop, val):
print '%s: %s' % (prop, val)
pp('media type', d.mimetype)

pp('has video', d.is_video)
if d.is_video:
pp('video caps', d.videocaps)
pp('video width (pixels)', d.videowidth)
pp('video height (pixels)', d.videoheight)
pp('video length (ms)', d.videolength / gst.MSECOND)
pp('framerate (fps)', '%s/%s' % (d.videorate.num, d.videorate.denom))

pp('has audio', d.is_audio)
if d.is_audio:
pp('audio caps', d.audiocaps)
pp('audio format', d.audiofloat and 'floating-point' or 'integer')
pp('sample rate (Hz)', d.audiorate)
pp('sample width (bits)', d.audiowidth)
pp('sample depth (bits)', d.audiodepth)
pp('audio length (ms)', d.audiolength / gst.MSECOND)
pp('audio channels', d.audiochannels)

sys.exit(0)

def discover(path):
def discovered(d, is_media):
if is_media:
succeed(d)
else:
fail(path)

d = discoverer.Discoverer(path)
d.connect('discovered', discovered)
d.discover()
gobject.MainLoop().run()

def usage():
print >>sys.stderr, "usage: gst-discover PATH-TO-MEDIA-FILE"
sys.exit(1)

def main(argv):
if len(argv) != 2:
usage()
path = argv.pop()
if not os.path.isfile(path):
print >>sys.stderr, "error: file %r does not exist" % path
usage()

return discover(path)

if __name__ == '__main__':
sys.exit(main(sys.argv))


Here is the output of this example script using a short mpeg video file:

media type: video/mpeg, systemstream=(boolean)true, mpegversion=(int)1
has video: True
video caps: video/x-raw-yuv, format=(fourcc)I420, width=(int)192, height=(int)192, pixel-aspect-ratio=(fraction)16/15, framerate=(fraction)24000/1001
video width (pixels): 192
video height (pixels): 192
video length (ms): 6831
framerate (fps): 24000/1001
has audio: True
audio caps: audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)1
audio format: integer
sample rate (Hz): 44100
sample width (bits): 32
sample depth (bits): 32
audio length (ms): 6831
audio channels: 1

Subscribe to: Posts (Atom)