This is a command line tool that decodes a video clip; applies edit decisisions (cutting, cropping and scaling); and re-encodes it. The idea is to cut and crop video to make it suitable for playback on a small screen mobile device by zooming in onto just the important bit - such as the face of the interviewee.
You supply a set of edit decisions in an XML file, and the MobileReframer will apply those to the source video file you provide, creating a new output video file with the resolution you specify
You can find the Mobile Reframer itself in /Sketches/MH/MobileReframe in the trunk of the subversion repository.
Running MobileReframer.pyRun MobileReframer.py from the command line and you'll get usage information:
> ./MobileReframer.pySo, for example, if you run it with the following command line:
./MobileReframer.py myVideo.avi myEditDecisions.xml theResult.avi 240 160 /tmp/mobile_reframer_scratchThis will apply the edit decisions in the xml file to the input video file and produce a result that is 240x160 pixels.
Note that you need to specify a temporary working directory for mobile reframer to use, since it needs somewhere to decompress video frames into. This temporary directory should not be being used by any other programs, including other instances of MobileReframer, and there should be enough free disk space to hold, in the worst case, the whole input video file when decompressed to raw frames and audio.
Writing the edit decision XML file
Write your edit decisions in an XML file, like this:
The above edit decision list, or a similar one, shoudl be in the file TestEDL.xml in the MobileReframer's directory.<?xml version="1.0" encoding="ISO-8859-1"?>
The format is pretty simple: simply specify a set of 'edits', in the order you want them to appear in the resulting video.
Each edit is a chunk of the input video specified by a start and end frame number, and then the bit of the video you want it cropped down to. Frames are numbered from zero, and coordinates are specified in pixels where (0,0) is the top left corner.
For example perhaps, for frames 25 to 49 inclusive (a 2 second chunk that starts 4 seconds into the video, assuming 25fps video) we want the video to be cropped to a region in the lower left of the image:
Then to achieve this we would write, as part of our edit decisions:
You can write your edit decisions in any order - you don't have to preserve the chronological order of the original video. For example, perhaps the video you are editing has 10 seconds of titles 30 seconds in from the start. Your edit decisions could specify that the output video should start with a few seconds of those titles, then return to something closer to the beginning.
You don't have to use the whole video - you can use your edit decisions to cut a video down into a shorter one.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved