1 (edited by fohrums 23-08-2016 14:15:15)

Topic: Avisynth-Script | Custom code | add lines to current script

```
svp_4_pro + mpc-be (default video/audio filters)
win10_home_x64
BenQ_XL2420TE_144hz
```

I found the perfect playback for my taste.

It consists of using both audio-delay & video-delay modifications respectively via:
  1) MPC-BE
    + audio-delay = `-23`
  2) SVP:Avisynth-script @ffdshow-raw-video-filter
    +  video-delay = `-50`

# SVP:mpc-be (settings)

* Pre-requisites
  + Add `ffdshow raw video filter` to External Filters
    - Options > External Filters > Add Filter...: `ffdshow raw video filter`
    - set to `Prefer`

* Audio-Delay
  + Define audio-delay
    - Options > Audio > Audio time shift (ms) > `-23`

* SVP:avisynth-script
  + Define video-delay
    - FFDshow Raw Video Filter > Avisynth > @end-of-script
    - `Trim(-50, 0, false)`

# PROBLEM

* When referring to the `SVP:avisynth-script` modification, settings don't save
  + The Avisynth-script will be flushed back to default

So, my question is how to keep this 1-line of code `Trim(-50, 0, false)` to stay static regardless of a new file being played. Most importantly have it stay static with any video-file being played for that matter.

__

## WHY THIS COMPLICATION - JUST FOR AUDIO / VIDEO SYNC?

* I literally feel like this produces the best results and i'm more enganged in the video it took me hours to see the *numbers* be set to such a perfect balance.

* This also led me to believe that `Video / Audio` playback from video-players produces a handicapp'd version of the playback when it could be enhanced magnificently.
  + This is the kind of stuff that makes me wanna scream ILLUMINATI-CONFIRMED.

Re: Avisynth-Script | Custom code | add lines to current script

> how to keep this 1-line of code `Trim(-50, 0, false)` to stay static

ranging methods from simple to advanced:

1. edit SVP/script/base.avs

2. edit SVP/script/generate.js, find the "gen_avs()" function

3. same as 2 but add some custom logic based on user-defined options (so you can for example have different scripts for different video profiles)

3 (edited by fohrums 23-08-2016 15:00:22)

Re: Avisynth-Script | Custom code | add lines to current script

Chainik wrote:

> 2. edit SVP/script/generate.js, find the "gen_avs()" function

I actually see 3-total results for that, not sure what exactly i'm suppose to do here, but here's a snippet.

```
    {
        case 0: return gen_avs(false);  //Avisynth
        case 1: return gen_avs(true);   //Avisynth+
        case 2: return gen_vs();        //Vapoursynth
    }
}

//generate AVS/AVS+ script file
function gen_avs(is_avsplus)
```

The reason why I don't prefer Option#1, is because there is no indication the
code is valid. I even tried higher / lower number examples to delay the
audio even more and it looked like that Option#1 doesn't work.

Re: Avisynth-Script | Custom code | add lines to current script

> not sure what exactly i'm suppose to do here

in the gen_avs() function body every

AVS.push("something")

adds another line to the resulting AVS script

if you're not familiar with JavaScript maybe it's better not to touch this file at all wink

> it looked like that Option#1 doesn't work

it should work if you add your Trim() call at the end of base.avs

5 (edited by fohrums 24-08-2016 01:53:58)

Re: Avisynth-Script | Custom code | add lines to current script

Chainik wrote:

(if we're talking about Option#1), it should work if you add your Trim() call at the end of base.avs

[SOLVED] Thanks.

This work, my bad I was editing the *.py-ver and not the *.avs-ver.
@end-of-script, it's actually placed under the END OF SCRIPT line.

6 (edited by fohrums 26-02-2017 02:38:56)

Re: Avisynth-Script | Custom code | add lines to current script

For those reading this post I apologize for how complicated as hell it seems. This is because i'm speaking technically from the very beginning and all through-out.

But I really intended to delay the audio from the player in combination w/ delaying the audio from SVP itself.

I no longer use this method as it's again -- really complicated! Instead, I set my player's audio delay at `-73` and it produces a relaxing result and from what ever distance i'm viewing my media at it just seems to be more in-sync that way.

This is the reason why I don't even watch YouTube from my browser no more.