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. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#21 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Dont know about ConvertAudio, but you could take a peek at Waveform by DavidHorman, better than AudioGraph.
http://forum.doom9.org/showthread.php?t=165703 EDIT: Not sure, think you may have had to include Internal.h for the ConvertAudio stuff.
__________________
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 ??? |
|
|
|
|
|
#22 | Link | |
|
Super Moderator
![]() Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
|
Quote:
Code:
AVSValue cache_args[1] = { _clip };
PClip ok_clip = env->Invoke("ConvertAudioToFloat", AVSValue(cache_args,1)).AsClip();
|
|
|
|
|
|
|
#23 | Link |
|
Registered User
Join Date: Mar 2007
Posts: 408
|
Thank you for the support. I must admit that FilterSDK/GettingStartedWithAudio even says "... It'll require you to include ConvertAudio.cpp ... " but I skipped that and it was just too unexpected one has to include AviSynth source.
|
|
|
|
|
|
#24 | Link | |
|
Super Moderator
![]() Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
|
Quote:
|
|
|
|
|
|
|
#25 | Link |
|
Registered User
Join Date: Aug 2006
Posts: 2,229
|
Are any of the changes in Avisynth+ (MT-r1689) included in this Avisynth? It would make sense to merge the two. I realise that Avisynth+ (MT-r1689) is a third party offshoot, but it does work well!
Last edited by burfadel; 16th February 2015 at 07:32. |
|
|
|
|
|
#28 | Link | |
|
Registered User
Join Date: Mar 2007
Posts: 408
|
Quote:
Code:
if (vi.HasAudio()) {
child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
PClip aud_clip = ConvertAudio::Create(child, SAMPLE_INT16, SAMPLE_INT16);
}
I think it should be Code:
if (vi.HasAudio()) {
child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
AVSValue invoke_args[1] = { child };
PClip aud_clip = env->Invoke("ConvertAudioTo16bit", AVSValue(invoke_args,1)).AsClip();
}
Last edited by martin53; 19th February 2015 at 19:33. |
|
|
|
|
|
|
#29 | Link | |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Looks ok to me but, what do I know
![]() From docs Quote:
Code:
try {
AVSValue args[1] = { child };
PClip reduced = env->Invoke("Reduceby2",AVSValue(args,1)).AsClip();
} catch (IScriptEnvironment::NotFound) {
env->ThrowError("MyFilterError: Whoa! Could not Invoke reduce!");
}
EDIT: On cache, I guess it provides a sensible default, Wilbert seemed to suggest invoke did not require it. Give it a whirl. EDIT: I think you will have to make a copy of vi, and copy contents over into it, and then update the audio related stuff. There might be some weird stuff related to cache that you have to handle for following filters. EDIT: Although in Prune(), I did not copy vi, just update contents of vi with eg Code:
vi.num_frames=OutFrameCount; // New Length of Output clip in Video Frames vi.num_audio_samples=vi.AudioSamplesFromFrames(OutFrameCount); // New number of Audio Samples
__________________
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; 19th February 2015 at 20:19. |
|
|
|
|
|
|
#30 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
M53, this seems to work ok, not much testing, does conversion before calling constructor, and just passes everything through untouched.
Code:
#include <windows.h>
#include "avisynth.h"
class audiotest : public GenericVideoFilter {
public:
audiotest(PClip _child,IScriptEnvironment* env);
// just pass it on using default audio handler of the ConvertAudioTo16bit filter
// void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env);
~audiotest(){};
};
audiotest::audiotest(PClip _child,IScriptEnvironment* env) : GenericVideoFilter(_child) {
// if(!vi.HasAudio()) env->ThrowError("audiotest: requires Audio"); // we already know it has audio
}
//void __stdcall audiotest::GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) {
// start and count are in multichannel samples, and 'start' is beginning of requested output samples to store @ buf.
// child->GetAudio(buf, start, count, env);
//}
AVSValue __cdecl Create_audiotest(AVSValue args, void* user_data, IScriptEnvironment* env) {
PClip child = args[0].AsClip();
const VideoInfo &vi = child->GetVideoInfo();
AVSValue ret;
if (vi.HasAudio()) {
// child->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
AVSValue invoke_args[1] = { child };
PClip new_clip = env->Invoke("ConvertAudioTo16bit", AVSValue(invoke_args,1)).AsClip();
new_clip->SetCacheHints(CACHE_AUDIO, 4096 * 1024);
ret = new audiotest(new_clip,env);
} else {
ret = child; // return original untouched
}
return ret;
}
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) {
env->AddFunction("audiotest", "c", Create_audiotest, 0);
return "`audiotest' audiotest plugin";
}
__________________
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; 20th February 2015 at 12:51. |
|
|
|
|
|
#31 | Link | |
|
Super Moderator
![]() Join Date: Nov 2001
Location: Netherlands
Posts: 6,375
|
Quote:
|
|
|
|
|
|
|
#32 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
There is some good stuff here on Cache:- http://forum.doom9.org/showthread.ph...50#post1595750
And presumably the line in blue two posts ahead is OKEY-DOKEY (and not on child before Invoke).
__________________
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; 19th February 2015 at 23:11. |
|
|
|
|
|
#34 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Small prob in colors_rgb.avsi,
Code:
global color_palegoldenrod = $EEE8AA global color_palegoldenrod = $EEE8AA
__________________
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 ??? |
|
|
|
|
|
#36 | Link |
|
AVS+ Dev
Join Date: Aug 2013
Posts: 359
|
Hi,
Among the changes in RC1, many ints in the public interface have been changed to size_ts, in a process to prepare for a 64-bit version. I would like to ask you to reconsider that, and revert those changes. The reason is, even though "official" AviSynth has never before supported x64, there are still a relatively large number of 64-bit plugins. These have existed for a long time, long before AviSynth+ (and some more sprouted after Avs+). These changes break all those plugins. Worse, these changes break those plugins without any real benefit. Changing frame offsets and datasizes to size_t, these can now hold values larger than 2GBs in 64-bit mode, but what video has a plane (or frame) size of 2GB? To summarize, I don't think these changes bring real value, but they necessitate the recompilation of all existing x64 plugins. Please consider reverting these changes.
__________________
AviSynth+ |
|
|
|
|
|
#37 | Link |
|
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
I'm pretty sure those changes are necessary for VapourSynth interoperability, though! (VS uses separate pointers for the planes instead of storing offsets.)
[citation needed] I'm also pretty sure the quality of the porting of most of the x64 plugins that actually do exist is rather low (and by that I mean someone just commented out everything that didn't work). Last edited by TheFluff; 9th March 2015 at 22:37. |
|
|
|
|
|
#38 | Link | ||
|
AVS+ Dev
Join Date: Aug 2013
Posts: 359
|
Quote:
Quote:
Edit: Added 6th link. This one is archive.org, but all the download links still work if you copy them.
__________________
AviSynth+ Last edited by ultim; 11th March 2015 at 10:16. |
||
|
|
|
|
|
#39 | Link |
|
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,685
|
I note that some filters that work yv12 work also with yv411 but with Garbage chroma like TFM() or both luma and chroma, Is this ok?
__________________
See My Avisynth Stuff |
|
|
|
|
|
#40 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Not sure what you are saying there but I'll take a guess.
I'm guessing that you have only just tried out v2.6 for the first time. v2.5 filters (compiled with v2.5 Avisynth.h version 3) cannot tell the difference between YV12 and other planar formats. If processing eg YV24 then the header used would give chroma rowsize and height as if for YV12, and the returned chroma might appear only in the Top Left Hand side quarter of the frame, the rest of the frame may (or may not) contain garbage chroma EDIT: 3/4 garbage chroma depends upon whether plugin does 'in-place' changes or creates new chroma plane (garbage). You can only use v2.6 planar compatible plugins with Avisynth v2.6 additional colorspaces.
__________________
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; 2nd April 2015 at 12:02. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|