Request for a new output format: AVS (AviSynthScript)

Where all the user feedback and suggestions for improvements go
Post Reply
Robbert
Posts: 1
Joined: Mon Jan 08, 2007 2:58 pm

Request for a new output format: AVS (AviSynthScript)

Post by Robbert »

From Videohelp.com:
AviSynth is a powerful tool for video post-production. It provides almost unlimited ways of editing and processing videos. AviSynth works as FrameServer, providing instant and very fast editing without the need for temporary files. Video editing using scripting.
http://www.avisynth.org/

(When you have Avisynth installed) An AVS-file is direct playable in Win Mediaplayer, Mediaplayerclassic and many more. So no need for cutting.
Trim (clip, int first_frame, int last_frame)

Trim trims a video clip so that it includes only the frames first_frame through last_frame. The audio is similarly trimmed so that it stays synchronized. If you pass 0 for last_frame it means "end of clip." A negative value of last_frame returns the frames from first_frame to first_frame + (- last_frame-1). This is the only way to get the very first frame!

Trim(100,0) # delete the first 100 frames
Trim(100,-100) # is the same as trim(100,199)
Trim(0,-1) # returns only the first frame

Code: Select all

#Example:
LoadPlugin("MPEG2Dec3.dll") #Or an other MPEG plugin
MPEG2Source("movie.mpg")
Trim(2234,12234)
...
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

From the documentation its not clear how multiple trim statements work together. Does each trim statement work on the output of the previous?
Say I need to EXCLUDE the following frame sequences, each line denotes one sequence to be excluded, 3 in total (yes, like comskip would detect the location of the commercials). starting frame number is 0, end frame number is unknown yet. (or must the end frame number be known to be able to write the trim statemens, if yes, assume its 40000)

1000 2000
5000 9000
20000 25000

How would the sequence of trim statements look that has the same effect?
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

Found the answer


1000 2000
5000 9000
20000 25000

translates to

trim(1.1000) ++ trim(2000,5000) ++ etc...
erik
Site Admin
Posts: 3369
Joined: Sun Aug 21, 2005 3:49 pm

Post by erik »

So its working now.

set in your comskip.ini
output_avisynth=1

For a .txt file that looks like

FILE PROCESSING COMPLETE 36550 FRAMES AT 2500
-------------------
1 8638
16807 22497
33631 36549

now an avs file is generated that contains

LoadPlugin("MPEG2Dec3.dll")
MPEG2Source("C:\Work\x\test\Coronation Street.mpg")
trim(0,1) ++ trim(8639,16807) ++ trim(22498,33631)

This is implemented in build 69 (to be released soon)
Could someone check if this is works?
Post Reply