Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 1st June 2013, 04:05   #1  |  Link
Kim Brandstetter
NSA Agent
 
Kim Brandstetter's Avatar
 
Join Date: Dec 2011
Location: Classified data
Posts: 21
Cutlist -> Frame Ranges for Loop/Trim

How do I convert a cutlist of

start: hours:minutes:seconds:milliseconds
end: hours:minutes:seconds:milliseconds

start1: hours:minutes:seconds:milliseconds
end1: hours:minutes:seconds:milliseconds

...

into frames ranges for Loop(0,start,end) or Trim?

I tried ((milliseconds/100)+seconds+(minutes * 60)+(hours*3600))*framerate but this cuts at the wrong position.
Kim Brandstetter is offline   Reply With Quote
Old 1st June 2013, 09:52   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,444
The divisor for milliseconds should be 1000, not 100, and the division has to be a floating point one, so you need to use milliseconds/1000.0.

Another point to think about is what happens when the time does not correspond to an exact frame boundary. Depending on the context, you might want to round the calculated frame number to the nearest integer (using the round() function), round down using floor() or round up using ceil().

Also bear in mind when interpreting the end time that Trim(a, b) includes frame b and Loop(0, a, b) deletes frame b.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 2nd June 2013, 06:11   #3  |  Link
Kim Brandstetter
NSA Agent
 
Kim Brandstetter's Avatar
 
Join Date: Dec 2011
Location: Classified data
Posts: 21
Yeah I found that out in the meantime, works better.
Kim Brandstetter is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:09.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.