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. |
![]() |
#2641 | Link |
Registered User
Join Date: Aug 2016
Posts: 516
|
ScriptClip appears to return audio from the clip being iterated on instead of the clip returned by the expression
Code:
global withAudio = ColorBars().ConvertToYV12().Text("withAudio") global withoutAudio = ColorBars().ConvertToYV12().KillAudio().Text("withoutAudio") ScriptClip(withoutAudio, "return withAudio", after_frame=true, local=false) # the returned clip appears to be equivalent to AudioDub(withAudio, withoutAudio) |
![]() |
![]() |
![]() |
#2642 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,430
|
Quote:
ScriptClip doesn't do any audio processing, it only operates on the video track. |
|
![]() |
![]() |
![]() |
#2643 | Link |
Registered User
Join Date: Aug 2016
Posts: 516
|
If it's by design, then I would say it's not very good design as I noticed just now that it also sets the field parity of the returned clip to that of the one being iterated on.
Code:
last = ColorBars().ConvertToYV12().KillAudio() global tff = last.AssumeTFF().Text("TFF", align=9) global bff = last.AssumeBFF().Text("BFF", align=9) ScriptClip(tff, "return bff", after_frame=true, local=false) info() Last edited by flossy_cake; 6th September 2023 at 19:30. |
![]() |
![]() |
![]() |
#2644 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,465
|
Quote:
|
|
![]() |
![]() |
![]() |
#2645 | Link | |
Registered User
Join Date: Aug 2016
Posts: 516
|
Quote:
I don't see the need to modify the audio or field order of the output clip. |
|
![]() |
![]() |
![]() |
#2646 | Link |
Registered User
Join Date: Aug 2016
Posts: 516
|
Also sorry if my comments about ScriptClip sound overly critical - I've been fighting with it the past few weeks and it's causing me a lot of headaches getting it to play nice with multithreading, avoiding memory leaks and my QTGMC output was broken due to this field order issue. Gavino's Grunt thread page 1 has some quotes from other members noting how quirky and strange the runtime environment is, so I know I'm not alone in this frustration.
|
![]() |
![]() |
![]() |
#2647 | Link | |
Registered User
Join Date: Aug 2016
Posts: 516
|
I'm just playing around with Avisynth's internal TimeStretch audio filter and was wondering about this:
Quote:
I was thinking... is it possible to somehow force a manual audio resync every n minutes, to nudge it back in sync? Could this be done in Aviysynth scripting or only within the TimeStretch plugin itself? |
|
![]() |
![]() |
![]() |
#2648 | Link | |
Moderator
![]() Join Date: Feb 2005
Location: Spain
Posts: 6,729
|
Quote:
The audio don't be never stretched, if it is not in sync with the video is a video fps problem. Play the video at fps it was filmed and the audio is always in sync. If you film the Usain Bolt 100 m WR (9.58 s) at 24 fps and play it at 25 fps you have a new WR of 9.2 s BTW if you want modify the real audio duration to fit the wrong video duration you can add some correction at your taste, there are audio editors.
__________________
BeHappy, AviSynth audio transcoder. |
|
![]() |
![]() |
![]() |
#2649 | Link | |
Registered User
Join Date: Aug 2016
Posts: 516
|
Quote:
Anyway, I'm not modifying the video fps at all. The TimeStretch function only processes audio, and I'm going to be modifying audio pitch while retaining audio length, and the wiki says audio length will be slightly off due to unavoidable rounding errors, and if the audio length is different then it's not going to be in sync with video. I tried to reproduce it by taking a 1hr clip and Loop(20).TimeStretch(pitch_n=24000, pitch_d=25025) to simulate pitch down of 4% and skipped to the end and audio was still in sync. But I don't think this simulates the issue - I'll probably have to leave the video running overnight and come back the next day and see if it's still in sync. If it isn't, then I had an idea: split the clip into say 3 hour chunks with Trim, and do the TimeStretch() on each individual clip before joining them back together with ++. But then maybe there will be a little audio glitch every 3 hours at the splice point. I think the optimal solution would be for TimeStretch to handle it internally and when it detects drift is > some value it should smooth over the resync point using its own timestretching algorithms. Last edited by flossy_cake; 19th September 2023 at 04:33. |
|
![]() |
![]() |
![]() |
#2650 | Link |
PgcEdit daemon
Join Date: Jul 2003
Posts: 7,460
|
It is usually assumed that an A/V difference of 100 ms or even more is not perceptible. So, unless you want absolutely to watch a 24 hours movie, you should not worry too much.
__________________
r0lZ PgcEdit homepage (hosted by VideoHelp) BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|