Hi, I have a patch against git HEAD to support the following use case:
My son, age 9, has gotten into stop motion animation and 'claymation'.
He was able to use PiTiVi to make a short movie, but the workflow was
fairly inefficient. He can import the pictures in the usual way, but
then has to shorten each 'clip' generated from an image from the
default 5 seconds to a more reasonable duration for stop motion.
Since even a short stop-motion movie can contain hundreds of frames,
and each clip has to be shortened individually, the current PiTiVi
doesn't support this use case very well.
The changes in 01-pitivi-duration.patch create a new configuration
variable to hold the default duration of clips imported from an image
file, with a minimum of 15 ms (about 60 frames/second). Sixty
frames/second is the upper bound for stop motion animation according
to Wikipedia. I picked a default of 250 ms (4 frames/second) because
it seemed like a good default for an amateur stop-motion user without
being too small for other users - a quarter-second frame should be
visible enough for the user to figure out what is going on and
lengthen the clip if needed.
I had to do a little fiddling to get a change to the preference dialog
to actually have an effect without save/reload. I think I did it
right, though.
After implementing the above, I uncovered what looks like two bugs in
the timeline zooming code when the clip duration is very short:
02-pitivi-duration.patch fixes:
File "pitivi/ui/mainwindow.py", line 715, in _setBestZoomRatio
ideal_zoom_ratio = ruler_width / float(timeline_duration / gst.SECOND)
ZeroDivisionError: float division
When timeline_duration gets to be smaller than gst.SECOND, the
denominator becomes 0 because that division is done with integers.
The patch simply casts timeline_duration to a float so we get float
division from the get-go. I think this affects normal users too,
because integer division makes the timeline zooming very 'chunky'.
03-pitivi-duration.patch:
After applying the above patch, I get:
File "pitivi/ui/zoominterface.py", line 112, in computeZoomLevel
return int((((ratio - cls.min_zoom) / cls.zoom_range) ** (1.0/3.0)) *
ValueError: negative number cannot be raised to a fractional power
When the ratio calculated above is smaller than cls.min_zoom, the
numerator becomes negative. I fixed this by returning cls.max_zoom if
ratio <= cls.min_zoom. With a very short clip, zooming in all the way
in is the right thing to do.
I tried to follow existing style as much as possible, but just let me
know if anything needs to be cleaned up.
Some ideas I have for future enhancements for stop-motion workflow:
o Change the preference from a bare millisecond value to something
more user friendly, like 'frames/second'. I'm not entirely sure what
the best way to handle this is, though. For instance, I considered just adding
dropdown like:
Default duration of clips created from image files:
60 frames/second
45 frames/second
30 frames/second
20 frames/second
10 frames/second
4 frames/second
1 frame/second
2 seconds/frame
5 secons/frame
10 seconds/frame
But that seemed ugly. And more work. And someone would inevitably
need some value left off of the dropdown.
Maybe a spinbox that updates automatically? Like:
Default duration of clips created from image files:
4 frames/second <>
Clicking the arrow automatically changes the text when you get
longer than 1 frame/second:
*click down arrow twice*
Default duration of clips created from image files:
2 seconds/frame <>
The wording of the option needs help too. :-/
o Allow the user to 'compress' and 'expand' groups of frames in the
timeline. Select some frames, right click, and get a 'compress/expand
clips' option.
o Better selection and handling of a large number of clips in the clip
library. For instance, if I add 20 clips, they get added to the clip
library in order, wrapping:
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
19 20
And then if I see that I only want clips 3-17 in the movie, there
isn't an easy way to select them, because shift-clicking selects a
square - click 3, shift-click 17, and I get 3-5, 9-11, and 15-17, not
3-17.
o Also any work on performance for large numbers of clips would help
stop-motion users - a 30-minute stop motion animation at
15 frames/second is 27000 clips!
o If the minimum frame duration stays at 15 ms, the maximum timeline
zoom level might need to be increased slightly. 15 ms clips are very
hard to grab in the timeline at maximum zoom right now.
Probably other things will come up, I'll need to give my son some time
to play with the current patch before he can provide more feedback. :-)
-RN
--
Robin Norwood
"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching
01-pitivi-duration.patch
Description: Binary data
02-pitivi-duration.patch
Description: Binary data
03-pitivi-duration.patch
Description: Binary data
------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________ Pitivi-pitivi mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pitivi-pitivi
