View Full Version : Testing Clip Type
flywitness
23rd September 2008, 16:04
I know there's loads of functions for testing a video clips properties such as if it is RGB or field based etc etc. Is there any way to test if a source is a static image (such as a jpg or png) or a video or perhaps even an audio file?
martino
23rd September 2008, 17:51
There is HasAudio() I believe. About the rest I thought check whether framecount is 1, however given how defaults work it'll be longer than that (not sure about the exact number right now when ImageSource is used or the other). However you could take a look at YDifferenceFromNext, and if it is 0 you know it'll be a static picture (although there's always the case of the video being static too -- more samples perhaps and averaging them?).
Gavino
23rd September 2008, 17:52
Is there any way to test if a source is a static image (such as a jpg or png) or a video or perhaps even an audio file?
Once you have a clip inside Avisynth, it has no knowledge of where it 'came from' (except in the source filter itself of course).
An audio-only clip can be identified by clip.HasVideo()==false.
A static image is harder to identify, as you would have to look at every single frame before you could be sure.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.