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. |
21st November 2008, 14:17 | #1 | Link |
AVStoDVD Dev
Join Date: Apr 2006
Location: Italy
Posts: 1,302
|
Universal Source functions
For my project AVStoDVD, I am trying to write a couple of fuctions (video and audio sources) that combine well known general purpose Source methods:
Code:
# Following AviSynth plugins are required: # FFMpegSource.dll @ http://forum.doom9.org/showthread.php?t=127037 # GetSystemEnv.dll @ http://avisynth.org/stickboy LoadPlugin("FFMpegSource.dll") LoadPlugin("GetSystemEnv.dll") Function A2DVideoSource(string VideoSource, bool "debug") { debug = default(debug, false) Try { SourceStr = "A2DVideoSource: AVISource" Video = AVISource(VideoSource, audio = false) } Catch(Err_Msg) { Try { SourceStr = "A2DVideoSource: DirectShowSource" Video = DirectShowSource(VideoSource, convertfps = true, audio = false) } Catch(Err_Msg) { SourceStr = "A2DVideoSource: FFmpegSource" Video = FFmpegSource(VideoSource, vcachefile = GetSystemEnv("temp") + "\A2DVideoSource.cache", seekmode = 0) } } Video = (debug == true) ? Subtitle(Video.Info(), SourceStr, font = "courier new", size = 16, align = 1) : Video return(Video) } Function A2DAudioSource(string AudioSource) { Try { Audio = DirectShowSource(AudioSource, video = false) } Catch(Err_Msg) { Audio = FFAudioSource(AudioSource, atrack = -1, acachefile = GetSystemEnv("temp") + "\A2DAudioSource.cache", acachefile2 = GetSystemEnv("temp") + "\A2DAudioSource2.cache") } return(Audio) } Bye |
|
|