Am 26.03.2013 um 03:50 schrieb Louis <[email protected]>:
> srcIn = 0
>
> srcDuration = trackFromToInsert.Duration*m.TimeScaleMBS
> // not sure how to find duration of created movie I always get 0,
> // no matter what I appended to the movie before
>
> dstIn = (m.Duration)*m.TimeScaleMBS
>
> trackFromToInsert.InsertTrackSegment(trackFromTheMovie, srcIn, srcDuration,
> dstIn)
First thing is that the multiply with time scale is wrong.
InsertTrackSegment needs time values in timescale and with the multiply you get
something very wrong.
You can divide by timescale to know time in seconds.
Second = Time / TimeScale
After adding images to a track with QTVideoTrack, please nil the track variable
to close it.
You also need BeginMediaEdits/EndMediaEdits which I just added to the plugins.
Fixed code:
dim movieToInsert, m as EditableMovie
dim f as FolderItem
dim track as QTVideoTrack
dim trackFromTheMovie, trackFromToInsert as QTTrackMBS
dim srcIn, srcDuration, dstIn as Integer
dim j as Integer
f=SpecialFolder.Desktop.Child("testMovie_1.mov")
if f.Exists then f.MoveFileTo(SpecialFolder.Trash)
m = f.CreateMovie
track=m.NewVideoTrack(320, 184, 32)
movieToInsert =
specialFolder.Desktop.Child("movieToInsert.mov").OpenEditableMovie
//add a few still images trackFromTheMovie here
for j=1 to 96
track.appendpicture mbs1
next
track = nil
trackFromToInsert = movieToInsert.GetVideoTrackMBS(1)
trackFromTheMovie = m.GetVideoTrackMBS(1)
if trackFromTheMovie<>nil and trackFromToInsert<>nil then
srcIn = 0
srcDuration = trackFromToInsert.Duration
// not sure how to find duration of created movie I always get 0,
// no matter what I appended to the movie before
dstIn = (m.Duration) * m.TimeScaleMBS
trackFromTheMovie.BeginMediaEdits
trackFromToInsert.InsertTrackSegment(trackFromTheMovie, srcIn, srcDuration,
0)
trackFromTheMovie.EndMediaEdits
end if
call m.CommitChanges
m = nil
f.launch
Greetings
Christian
--
Read our blog about news on our plugins:
http://www.mbsplugins.de/
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info