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 |
|
|
#1 | Link |
|
NSA Agent
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. |
|
|
|
|
|
#2 | Link |
|
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. |
|
|
|
![]() |
|
|