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. |
31st December 2012, 00:31 | #1 | Link | |
Registered User
Join Date: Aug 2006
Location: USA
Posts: 59
|
Problem with avisynth BlankClip()
I am just starting doing video work on a faster Windows 7 system, and I am puzzled with an issue I have with BlankClip.
I am using Avisynth 2.5.8 and Virtualdub 1.9.11 (32-bit) I am using that BlankClip in some scripts where I don't need the audio stream, according to the avisynth wiki on BlankClip: Code:
# adds a silent audio stream (with a samplerate of 48 kHz) to a video clip: video = AviSource("E:\pdwork\DO-Heaven.AVI") audio = BlankClip(video, audio_rate=48000) AudioDub(video, audio) Quote:
If I want to feed VirtualDub with just a one-line script: Code:
BlankClip(color=$0000FF) If I want to use: Code:
BlankClip(color=$0000FF) video = KillAudio(last) # Eliminate audio stream audio = Blankclip(video, audio_rate=48000) # Create blank audio stream Audiodub(vid2, audio) # Remux I don't have any clue about what is going on. I have been using avisynth scripts with BlankClip for a long time on XP and Win7 without any problem. I would greatly appreciate any comment on that issue. Thanks. Last edited by JeanMarc; 31st December 2012 at 00:35. Reason: Additional detail |
|
31st December 2012, 01:55 | #2 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Quote:
EDIT: If you change vid2 to video, you get a "unable to download appropriate decompressor" and a clip in blue. (mplayer2) Audio problem, suspect problem in 2nd Blankclip, duplicating a null audio clip @ 48khz. (looks like a real bug to me, I'm on 2.6a3). Trying to convert a null (zero) hz clip to 48khz produces a divide by zero. Blankclip is trying to duplicate the properties of the first clip, and then convert to 48khz produces the /0.0 (perhaps mismatch between what KillAudio thinks is killed and convert sample rate thinks is dead). EDIT: BlankClip(color=$0000FF) Killaudio() Blankclip(audio_rate=48000) # OK # Last.Blankclip(audio_rate=48000) # NOT OK # Think this bug has already been reported and fixed (in some future release), implicit versus explicit Last (implicit not really used, bug in explicit). EDIT: think its been reported, searched, could not find.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 31st December 2012 at 03:15. |
||
31st December 2012, 06:20 | #3 | Link | |
Registered User
Join Date: Aug 2006
Location: USA
Posts: 59
|
Quote:
It might be a bug. But I need to do more tests tomorrow. I just realized that on the previous win7 system I am trying to move away from, these clips with BlankClip are also causing the same problems with VirtualDub. I just didn't see them as what I was doing was using that clip (with the blank audio) to encode them into an x264 mp4 video-only stream with ffmpeg. Ffmpeg complained about the audio, but I was getting the video stream I needed. I will try to do a closer comparison of what is happening on the two platforms tomorrow. I will report here. Regarding the script: Code:
BlankClip(color=$0000FF) Killaudio() Blankclip(audio_rate=48000) # OK # Last.Blankclip(audio_rate=48000) # NOT OK |
|
31st December 2012, 12:07 | #4 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
BlankClip takes any unspecified properties from the source ('template') clip, so you need to specify all the audio properties together (audio_rate, channels and sample_type) if the template has no audio. |
|
31st December 2012, 14:46 | #5 | Link |
Registered User
Join Date: Aug 2006
Location: USA
Posts: 59
|
for this detail. I was wrongly assuming that blankclip would always provide the default stream definition (I think it's 44100 Hz, 1 channel, 16bit).
I can see now that: Code:
BlankClip(color=$0000FF) video = KillAudio(last) audio = Blankclip(video, audio_rate=48000) Audiodub(video, audio) Code:
BlankClip(color=$0000FF) video = KillAudio(last) audio = Blankclip(video, audio_rate=48000, channels = 2, sample_type = "24bit") Audiodub(video, audio) Problem solved! |
31st December 2012, 15:15 | #6 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
OK, all audio parms should be provided, but divide by zero is still a bug.
I'm a bit knackered, think I'll take the rest of the year off. Happy New Year.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
31st December 2012, 17:23 | #8 | Link | ||
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
(BlankClip() doesn't need to do sample rate conversion, it just returns zeroes for all GetAudio() requests.) The problem with the original script is that you end up with a clip with badly formed audio properties - a non-zero sample rate (so satisfies HasAudio()), but no audio channels and a sample type of 'NONE'. Perhaps it would be better if BlankClip(), when given a clip without audio, and explicit audio parameter(s), took the missing audio properties from the 'default' case, rather than from the source clip. (However - as now - when the template clip does not have an audio track, it should not add one if no audio parameters are provided.) Quote:
Happy New Year, everyone! |
||
1st January 2013, 12:30 | #9 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
One year later ...
Sorry to revive this old thread, but I dont think that was the thread I saw (sometime within last 6 months) but about the same content.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
7th November 2014, 20:27 | #11 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
There are many ways to make a pattern clip with two colors, but they should be discussed in a new thread. (BlankClip does not have patterns, it has one color only)
* EDIT - re original question: Code:
audio = Blankclip(video, audio_rate=48000) # wrong audio = Blankclip(audio_rate=48000) # right * EDIT another way: Code:
Tone(length=(video.FrameCount/video.FrameRate), samplerate=48000, channels=2, type="silence", level=0.0) Last edited by raffriff42; 7th November 2014 at 20:50. |
7th November 2014, 20:31 | #12 | Link |
Registered User
Join Date: Jul 2010
Location: Germany
Posts: 357
|
Code:
BlankClip(1, 16, 16, "RGB24") StackHorizontal(last, last.Invert) StackHorizontal(last, last) StackHorizontal(last, last) StackHorizontal(last, last) StackHorizontal(last, last) StackHorizontal(last, last) StackVertical (last, last.Invert) StackVertical (last, last) StackVertical (last, last) StackVertical (last, last) StackVertical (last, last) |
15th November 2014, 13:34 | #13 | Link | |
Registered User
Join Date: Mar 2009
Posts: 14
|
Quote:
great thanks for this? Last edited by gencom; 15th November 2014 at 13:56. |
|
15th November 2014, 16:56 | #14 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Create two clips, dark and light blue. Combine them like this: http://avisynth.nl/index.php/WeaveColumns.
|
15th November 2014, 21:07 | #15 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
WeaveColumns/Rows v2.60 only.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
|