Log in

View Full Version : suggest Audio flag in ImageSource


vcmohan
21st July 2006, 04:01
Currently imagesource does not have any audio. I assume that it will be a very rare requirement of not having audio. Mostly this clip will be attached to some main clips with audio. I therefore request that an option to have silent audio such as that exists for blankclip be provided. It may have an option not to have any audio. Right now a bit complicated code is required to add audio to ImageSource.

foxyshadis
21st July 2006, 05:39
Imagesource("...")
audiodub(blankclip(last))

is complicated?

vcmohan
22nd July 2006, 03:06
Let me tell you my problem. In my home video I add at different places stills which are stretched to different lengths. I have to add at each place a audiodub line with correct parameters for blank clip audio and length. At a few places it is ok but at different places and when you frequently change the length, it becomes an annoyance. I thought it may be easier if an expression like imagesource(............,video,...) if possible then audio will be automatically of that of the video clip and of correct length. Well this is only a suggestion. If not practicable I will live with the existing procedure.

stickboy
23rd July 2006, 04:09
I say no. It doesn't semantically make sense for ImageSource to do anything with audio.

For your specific needs, you can write a wrapper function similar to the following (although this is untested):
function MyImageSource(...)
{
AudioDub(ImageSource(...), ...)

# If the audio duration is longer than the video duration, I
# think Trim will cut off the audio excess.
#
# If the audio duration is shorter than the video duration,
# using AlignedSplice (++) will fill in the missing samples with
# with silence.
return Trim(0, FrameCount())
}

Fizick
27th July 2006, 19:13
function Silence(clip input)
{
return audiodub(input,blankclip(input,audio_rate=48000,stereo=true))
}
Imagesource(...).silence()


Of cource, this function can be used not only with Imagesource. :)

But may be we really needed in more simple way to add audio?
May be to modify BlankClip or Tone?

matrix
30th July 2006, 02:18
I'm having some problems using your function (mabe I do it wrong?)

function Silence(clip input)
{
return audiodub(input,blankclip(input,audio_rate=48000,stereo=true))
}
Imagesource("C:\MOVIES\pic.bmp", 0, 599, 29.97).silence()

In mediaplayer I get this error message:
"CoInitialize has not been called."

Virtual dub just vanishes.

Any ideas?
Thanks

foxyshadis
30th July 2006, 02:49
Try installing the latest version of avisynth. Do other scripts work? Because it sounds like it either isn't installed or the install is broken somehow.

matrix
30th July 2006, 13:59
Thanks

I had the latest version, and everyting else is working. I just download it and install it again, but same problem.
Could my system be at fault somehow?

stickboy
30th July 2006, 19:30
Other scripts work?

Perhaps try temporarily emptying your plugin directory?

matrix
30th July 2006, 21:34
OK, I did that, and now vdub doesn't vanish anymore, instead it gives me this message:

An integer division by zero occurred in module 'VirtualDub'.

VdubMod just crashes, and mplayer same as before.
All other scripts work.
I tried, swiching to earlier versions of avisynth, with no luck.

foxyshadis
31st July 2006, 01:14
http://foxyshadis.slightlydark.com/random/funky_yuy2.avi
http://foxyshadis.slightlydark.com/random/funky_yv12.avi

These are raw, 1-frame yuy2 and yv12 avis. If they cause the same crash, it's because of the decoder. Have you installed any new codecs around when it started happening? (Even an update to ffdshow or xvid.)

matrix
1st August 2006, 00:12
Those files open just fine, in both mplayer and vdub. And no, I haven't installed or updated any codecs.
The only thing I can think off is a few weeks ago I had a problem.
I download and installed a firmware upgrade for my lightscribe burner. And after that photoshop didn't work anymore. I uninstalled it, installed it again, and nothing. I tried restoring the computer to an earlier date, wich didn't fix the problem. So I have a image of my op.system I made with norton ghost, on my other HD, a couple of years ago, and I did a restore from that image.(I do that every once in a wile)
Everything works fine. All my scripts and everything else.
Sometimes I do something similar to vcmohan and I used to specify the duration in the blankclip like this
left_channel = BlankClip(length=599,width=720,height=480,fps=29.970,color=$ffffff)
right_channel = BlankClip(length=599,width=720,height=480,fps=29.970,color=$ffffff)
audio =MonoToStereo(left_channel, right_channel).resampleaudio(48000)
AudioDub(video,audio)
so when I saw this post, it was appealing to me, and that's how I got here.
It's curious though, that everything else works.
An besides, that image was done after all my programs were installed, tested, and properly working.

Anyway, if there's no alternative, I can live with what I have.

Thanks guys for your time and efforts.