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. |
|
|
Thread Tools | Search this Thread | Display Modes |
18th August 2020, 22:09 | #62 | Link |
Registered User
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
|
> Variable frame rate video: I don't have any experience about this.
You'll have different frame durations for different frames So your method of getting frame time from frame number, based on a fixed frame duration, will fail - it'll return wrong frames. You need to count input frames, and return the exact frame (by number) when it's requested. > Do you have any sample video? Basically any anime video out there is VFR in some parts. > How does ffdshow behave? Does it treat like dynamic format change? It's not a format change. Since ffdshow works with frame numbers it doesn't have any problems here. > When I put SVSmoothFps_NVOF() in script, and NOT recreate the avs environment every time I connect pin or seek, the filter just freezes. I'll take a look...
__________________
SVPflow motion interpolation |
19th August 2020, 14:18 | #63 | Link |
Registered User
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
|
I wonder if it's really necessary to reload script so many times?
Considering the simple YV12 playback, it's reloaded: - 4 times in CheckConnect - 1 time in HandleInputFormatChange - 1 time in TransformAndDeliver total of six (6) times just to start the playback, plus one time for every set on pause (why??). And each time SVSmoothFps have to init and destroy OpenCL context, queues, build shader programs etc., plus init/destoy CUDA context for NVOF. I'd at least remove Reset() from pause handler... 5 times re-init is better than 6 === The "NVOF problem" - my guess is it arises from the fact that when reloading script w/o deleting the environment, the "new" filters initialization might occur before destruction of "old" filters.
__________________
SVPflow motion interpolation Last edited by chainik_svp; 19th August 2020 at 14:39. |
19th August 2020, 21:17 | #64 | Link |
Registered User
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
|
Regarding VFR. Just played with an anime file where frame rate is constantly floating between 24 and 30 fps, and found that IMediaSample::GetTime() is returning incorrect end-time - it's always equal to start-time plus average-time-per-frame defined in VIDEOINFOHEADER. However subtracting previous frame's start-time from the current frame's start-time gives correct value.
__________________
SVPflow motion interpolation |
20th August 2020, 06:38 | #65 | Link |
Registered User
Join Date: May 2019
Posts: 42
|
clsid: Thanks for info. However I tested in the latest Windows 10 (ver 2004) though. My MPC-HC version is 1.9.4.21 (daeb8bf8d).
VFR: "You need to count input frames, and return the exact frame (by number) when it's requested." But you are assuming the samples we receive are ordered and continuous. Upstream can give us frame #X then #X + 2 in case of frame drop. And if seek happens, all we know is the time of that frame. Why does avs take frame number instead of frame time? Does that mean avs only support CFR? I also played a VFR video (where ffmpeg vfrdet reports "VFR:0.501632 (1076/1069) min: 3753 max: 15015 avg: 3777"). I don't see any problem during playback. Reload: You can read my comment in filter.cpp. I hate reloading. It destroys performance. But I think every single one of them is necessary. CheckConnect: Reason why reload is to feed the script new input format. Each time the upstream gives me a new media type. I need to run through the script to get the corresponding output format, then feed it to downstream. Good news is these reload only reload the script, not the whole avs environment (because there is no frame generated yet). HandleInputFormatChange: Same reason as above. New input media type, thus reload. Bad news, since the playback is already started, there could be frames inside avs. To flush the cache, we need to reload the whole thing. Maybe one day we will get some answer from https://github.com/AviSynth/AviSynthPlus/issues/180. TransformAndDeliver: This is for Pause(). As you may know, the DirectShow document specifically requires filters to "discard any samples that were created before the seek command". We could flush cached frames in our filter, but we can't control any caching in avs. Thus a full reload is done every time user seeks. You could argue that it is not strictly "necessary", but then you will encounter the same ghost frame problem as in ffdshow, that after seeking you still see a bunch of frames around the time before seeking. I'd rather the seek taking a bit of time than seeing wrong frames. NVOF: You are correct full reload works. The first 5 reloads (being full or not) are not the concern because they are generally not user visible (usually one time per playback). However, if every time we completely reload the environment there is no problem. But doing full reload in Pause() will impose unbearable latency for seeking. So either AviSynth gives us proper flushing method, NVOF somehow can do without full reload, or use NVOF with ghost frame. Last edited by CrendKing; 20th August 2020 at 07:30. |
20th August 2020, 08:34 | #66 | Link |
Registered User
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
|
> Thus a full reload is done every time user seeks.
seek != pause > I don't see any problem during playback. and still you 1. fetch the wrong frames using fixed frameTime value while converting requested frame number to timestamp 2. pass a cfr sequence to downstream
__________________
SVPflow motion interpolation Last edited by chainik_svp; 20th August 2020 at 08:47. |
20th August 2020, 11:03 | #67 | Link | ||
Registered User
Join Date: May 2019
Posts: 42
|
Quote:
Quote:
|
||
20th August 2020, 13:40 | #68 | Link |
Registered User
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
|
> So feeding any VFR to AVS would only get out CFR. Am I wrong?
you feed AVS with a frame sequence and you get another frame sequence back, it's up to you how to set timestamps what I know is ffdshow somehow managed to deal with VFR input/output https://github.com/jeeb/ffdshow-tryo...synth.cpp#L975
__________________
SVPflow motion interpolation Last edited by chainik_svp; 20th August 2020 at 15:33. |
20th August 2020, 23:01 | #69 | Link |
Registered User
Join Date: May 2019
Posts: 42
|
I get it now. Basically we need to calculate the output frame duration ourselves, by applying the avs scaling (where the scaling itself is fixed at e.g. 2x, 1.5x, etc) to the source frame duration. And to get the frame number, we need to count from start or last seek point, instead of relying on the average frame duration, which is just a statistic number and rather meaningless. And for seeking, I don't need to care about anything before seeking. Just rebuild the frame queue from anew.
Last edited by CrendKing; 21st August 2020 at 00:18. |
28th November 2020, 16:42 | #71 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
not anymore, I don't see any problem in multithreading stablety in AviSynth+ 3.6.2-test4 20201112
__________________
See My Avisynth Stuff |
29th November 2020, 14:45 | #72 | Link | |
Registered User
Join Date: May 2019
Posts: 42
|
Quote:
Technically I could create a version of this filter that uses VapourSynth instead of AviSynth as the frame server (I have a working internal version but extremely buggy, not actively working on it), but since it pulls in Python in runtime thus way heavier in footprint, I need some good use case and incentive to do that work. |
|
2nd December 2020, 04:27 | #73 | Link | |
Registered User
Join Date: Apr 2015
Posts: 84
|
Quote:
Currently, VapourSynth HDB support and multithreading are much better than AviSynth+. You can try some complex script with multithreading e.g: QTGMC + fslg_quick_denoise + mcDAA3. |
|
2nd December 2020, 07:02 | #74 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
HDB support maybe not as the vs one since there are few plugins need to add HBD in avs+, but again it's way better than 2019, since https://github.com/Asd-g?tab=repositories did added a lot since then
__________________
See My Avisynth Stuff |
|
3rd December 2020, 19:49 | #75 | Link |
Registered User
Join Date: May 2019
Posts: 42
|
Also remember that since the use case here is real-time video playing, having complex script that requires significant CPU time would jeopardize your experience. For instance, playing a 60 fps video means you can't spend more than 16.6ms per frame on both decoding, avs and rendering, or you will start to drop frames. So essentially we only need to concern about a very subset of functionality. As long as this subset is stable, it's fine.
|
5th December 2020, 14:10 | #76 | Link | |||
Registered User
Join Date: Mar 2016
Posts: 160
|
Hello.
I've faced several problems with AVSF, not sure where to report it. 1. On the new PC manually installed AVSF didn't appear in the player's filters list (and don't work) until activate_remote_control.reg is applied. Is it a bug or a feature? 2. Player hangs on start if this script is loaded: Quote:
3. QTGMC and ApparentFPS work great individually, but not in one script. This script plays choppy, but seeking works: Quote:
Quote:
__________________
I'm infected with poor sources. |
|||
5th December 2020, 17:36 | #77 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I cant remember what AvsFilterSource() is, but suggest RequestFramesLinear() [with appropriate cache args] inserted after AvsFilterSource.
Before and After cache args might best be at least the framerate of the source clip. [maybe] EDIT: or maybe if still probs, try at least the framerate of the source clip * Prefetch. EDIT: Note, ApparentFPS() has to access 2*FrameRate [by default] frames everytime you jump about, hence hang especially due to QTGMC doing its stuff for each of those. EDIT: ApparentFPS() wil need linear access, need set as such in your SetMTMode.avs thing. [MT_SERIALIZED] so probably best placed AFTER Prefetch().
__________________
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; 5th December 2020 at 19:00. |
6th December 2020, 11:05 | #78 | Link | |||
Registered User
Join Date: May 2019
Posts: 42
|
Quote:
Quote:
I thought "Prefetch" has required thread number argument. Have you tried adding it? I've tested FDecimate2 before, but never tested TDecimate. Please report on separate issue. However, we should first solve the installation issue. I'm not even sure you are actually loaded the filter in its expected state. I thought "prefetch" must be the last statement in a script. Am I wrong? Reference: http://avisynth.nl/index.php/AviSynth%2B: Quote:
Last edited by CrendKing; 6th December 2020 at 11:09. |
|||
6th December 2020, 17:04 | #79 | Link | ||||||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Quote:
Eg, a machine might have 2 physical Xeon CPUs, each with 6 physical cores and 6 logical cores, 12 physical [EDIT: total] cores per CPU, or 24 threads/cores total machine. Dont know if Physical_CPUs means physical_cores in single CPU, or eg total number of physical cores in multi CPU Xeon system. Quote:
Quote:
it is more usually called with implicit Last clip, it also returns a video clip, and has never had to be final filter in script, although that has been its usual use in the past. I'm pretty sure that there was a Pinterf post [which I did not find] that showed multiple use of Prefetch in single script, multi-use was quite recent mod to avs+. [EDIT: I only searched Devs forum, maybe was in Usage] Quote by Pinterf, [cant directly quote a closed thread any more ???]:- https://forum.doom9.org/showthread.p...72#post1904672 Quote:
and threads default = physical cores + 1, frames default is presumably 1 [although defaults tend not to be shown] EDIT: Threads is Optional, should be enclosed in double quotes. Code:
Prefetch (clip c, int "threads"=Physical_cores+1, int "frames"=1) # returning video clip Quote:
__________________
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; 6th December 2020 at 19:28. |
||||||
|
|