- Messages
- 2,685
- Reaction score
- 8
- Trophy Points
- 48
Which filters are you using?
Vote NOW for October FEOTM!
Spline36Resize(1280,720)
ResampleHQ(1280,720)
Loadplugin("C:\Editing Tools\AviSynth 2.6\plugins\resamplehq-x86.dll")
DirectShowSource("C:APIMoM.grf", fps=23.976, audio=false)
Assumefps(24000,1001)
ConverttoRGB(matrix="Rec709")
ResampleHQ(1280,720)
Captain Khajiit said:3c) Decoding progressive AVC with ffmpegsource2
Make sure that you have demuxed your video to MKV (not an elementary stream) with Eac3to. Download the latest version of ffms2. Inside the folder, you find will find the ffms2.dll and FFMS2.avs. Copy both to your Avisynth plugins directory. Make sure that you have the Haali Media Splitter installed. Use the following script, adjusting it to fit your directory structure.
Loadplugin("C:\Program Files (x86)\Haali\MatroskaSplitter\avss.dll")
FFmpegSource2(âwherever\whatever.mkvâ)
Assumefps(24000,1001)# assumes a 23.976fps source
FFMS2 is frame accurate, but it occasionally gets the frame-rate wrong. The last line corrects it. It assumes a 23.976fps source, which your source probably is if it is progressive AVC. You might have a rare, pure-24fps BD, in which case use Assumefps(24,1).
Open your script in Virtualdub to preview it.
N.B. FFMS2 works by making an index. Sometimes this takes a while, so be patient.
theslime said:Could it possibly be a bug in the FFMS2 code?
Also, I used FFvideoSource() instead of FFmpegSource2() since that's what their documentation says you should use for video-only
theslime said:Now the fun begins - actually editing a movie with Avisynth. Yes, I'm a masochist.![]()
FFvideoSource("C:\VIDEO\video.mkv").ConvertToRGB24().ChannelMixer(100,-9,-14,5,86,-8,7,0,114).ConvertToYV12().Tweak(0,1.1,-10,1)
theslime said:The only wonky part of it is that the plugins work in different colour spaces.
vid=FFvideoSource("C:\VIDEO\video.mkv")
cc=vid \
.ConvertToRGB24() \
.ChannelMixer(100,-9,-14,5,86,-8,7,0,114) \
.ConvertToYV12() \
.Tweak(0,1.1,-10,1)
last=MergeChroma(vid,cc)
return last
Captain Khajiit said:I'll have a look through my files and shoot you a PM detailing the functions and my usual method in the next day or so.
WhateverSource(“my_source_file”)
Crop()
Reduceby2()
vid=AviSource()
ConverttoRGB()#if necessary
#all
#my
#editing
ConverttoYV12()#if necessary
return vid
vid=WhateverSource(“my_source_file”)
ConverttoRGB()#if necessary
#all
#my
#editing
ConverttoYV12()#if necessary
return vid
vid=AviSource() \
.ShowFrameNumber(scroll=true)
videdit= \
Trim(vid, 0, 3000) ++ \
Trim(vid, 4100, 0)
return videdit
vid=AviSource()
aud=WavSource()
dub=AudioDub(vid,aud)
function ParabolicCrossFade(clip c1, clip c2, int n, float "factor") {
factor = Default(factor, 2.0)
d = Dissolve(c1, c2, n)
df = Dissolve(c1.FadeOut0(n), c2.FadeIn0(n), n)
audio = MixAudio(d, df, factor)
AudioDub(d, audio)
}
vid=AviSource() \
.ShowFrameNumber(scroll=true)
aud=WavSource()
dub=AudioDub(vid,aud)
#Audio track
audedit= \
ParabolicCrossFade( \
Trim(dub, 0, 3000), \
Trim(dub, 4000, 0), 100, 1.2 \
)
#100 = no. of frames
#1.2 = the mixing factor
#Video track
videdit= \
Trim(vid, 0, 3000) ++ \
Trim(vid, 4100, 0)
stack=stackvertical(audedit, videdit)
return stack
# Arguments:
# mode: 0=Histograms, 1=Show Hot Pixels, 2=Video Channels,
# 3=Waveform Monitor, 4=Vectorscope
#
# (input Characteristic args mainly used for luma calcs)
# NTSC vs PAL
# stdDef (601) vs hiDef (709)
# rng255 vs rng219 (Pick rng255=false if you want luma black=0)
#
# (show channels used in modes 0,2,3)
# luma,red,green,blue
#
# hotFixMode: 0=turn hot pixels black, 1=lower intensity, 2=lower saturation
# showWFMgrid: turn it off to see better.
function VD_clrtools(clip clip, int "mode",
\ bool "NTSC", bool "stdDef", bool "rng255",
\ bool "luma", bool "red", bool "green", bool "blue",
\ int "hotFixMode", bool "showWFMgrid")
{
[B]LoadVirtualdubPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\clrtools.vdf", "_VD_clrtools")[/B]
return clip._VD_clrtools(default(mode,0),0,0,
\ default(NTSC,true)?1:0,0,
\ default(stdDef,true)?1:0,
\ default(rng255,true)?1:0,
\ default(luma,true)?1:0,
\ default(red,true)?1:0,
\ default(green,true)?1:0,
\ default(blue,true)?1:0,
\ default(hotFixMode,0),
\ default(showWFMgrid,true)?1:0)
}
__END__
#Example Usage:
#avisource("my.avi", pixel_type="RGB32")
#Luma Histogram Only
#VD_clrtools(mode=0,red=false,green=false,blue=false)
#Luma Waveform Monitor
#VD_clrtools(mode=3,red=false,green=false,blue=false)
#Vectorscope
#VD_clrtools(mode=4)
AviSource().VD_clrtools(mode=4)
#for a 720x480 NTSC video
vid=AviSource()
scope=vid \
.VD_clrtools(mode=4) \
.BilinearResize(480,480)
last=StackHorizontal(vid,scope)
return last
function InsertFramesMC(clip Source, int N, int X)
{
# inserts missing frames using motion interpolation
# N is the frame number before which the sequence will be inserted
# X is number of frames to insert
# the video length is increased by X frames
# won't work for N=0, N>last
#
# e.g. InsertFramesMC(101, 5) would
# keep the source's frames from 0 to 100
# create and insert 5 motion interpolated frames (based on source frames 100 and 101)
# append the source's frames 101 to the end
# audio is silent during the inserted frames
start=Source.trim(N-1,-1) # frame before N, used for interpolation starting point
end=Source.trim(N,-1) # frame at N, used for interpolation ending point
start+end # join them into a two frame video
AssumeFPS(1) # temporarily FPS=1 to use mflowfps
super = MSuper()
backward_vec = MAnalyse(super, isb = true)
forward_vec = MAnalyse(super, isb = false)
MFlowFps(super, backward_vec, forward_vec, blend=false, num=(X+1), den=1)
Trim(1, X) # trim ends, leaving only the frames for insertion
AssumeFPS(FrameRate(Source)) # return to source framerate for joining
Source.trim(0,-N) ++ last ++ Source.trim(N,0) # join, before, inserted, after
}
paraboliccrossfade( \
trim(first_clip, 20000, 20165), \
BlankClip(first_clip, length=80, color=$000000), 10, 1.4) \
.paraboliccrossfade( \
trim(second_clip, 20475, 22000), 100, 1.2 \
)
#Dissolve() can be called in the same fashion.