On Sun, 2009-03-29 at 18:05 -0400, Josh Narins wrote:
> Does anyone have anything that can be run from the command line which
> would create a Project, add some Files to the Timeline, then save the
> project?
>
> I'm getting a little confused when it comes to FileSourceFactory (is
> that even what I need) and what actually needs to be done to get a
> "/path/to/file.png" to become an object I can add to the Timeline.
>
> It wasn't so hard to get this far...
The problem you're hitting is that most of PiTiVi's code is
asynchronous. Therefore you can't just 'add' random stuff to a
timeline/project like you're doing.
The best for this would be to create your own playlist or EDL format
as mentionned in the other thread. I'll push to have the 'formatter'
branch merged this week, and might take up the task of writing this
simple format parser.
Edward
>
> #!/usr/bin/env python
>
>
>
> # my first python script :)
> import sys
> import gtk
> import gst
> sys.path.insert(0,'/usr/local/lib/pitivi/python')
>
> # load the pitivi stuff
> import pitivi.pitivi as ptv
> from pitivi.project import Project
> from pitivi.timeline.timeline import Timeline
> from pitivi.timeline.source import TimelineFileSource, TimelineSource
> from pitivi.projectsaver import ProjectSaver
> from pitivi.objectfactory import FileSourceFactory, PictureFileSourceFactory
>
> # start a new project
> uri = "/home/josh/test_project"
> project = Project(uri=uri)
> timeline = Timeline(project=project)
> source = TimelineSource(timeline)
> fsf =
> FileSourceFactory(filename="/home/josh/media/gimp/plasma_cloud_fade.png")
>
> try:
> fileobj = open(uri,"w")
> loader = ProjectSaver.newProjectSaver("pickle")
ProjectSaver is dead, the new technique to load/save projects is
the 'Formatter'.
> tree = project.toDataFormat()
> loader.saveToFile(tree,fileobj)
> print "project saved successfully"
> except IOError:
> print "couldn't save"
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Pitivi-pitivi mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pitivi-pitivi
------------------------------------------------------------------------------
_______________________________________________
Pitivi-pitivi mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pitivi-pitivi