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.

 

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 21st November 2008, 14:17   #1  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
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)
}
I am not a great AviSynth scripter, any suggestion how to improve it will be appreciated.



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
 


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 07:48.


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