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. |
21st June 2017, 10:10 | #3461 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
I've noticed the same with John Meyer's simpler script. It has to be one (or a combination) of the mvtools2 functions that does not scale well with MT.
Edit: Throwing more threads at it seems to improve things without compromising efficiency (CPU with 4 cores/threads): Code:
Prefetch(4): FPS (min | max | average): 4.755 | 275350 | 48.26 Memory usage (phys | virt): 310 | 409 MiB Thread count: 15 CPU usage (average): 66% Efficiency index: 0.7312 Prefetch(6): FPS (min | max | average): 17.36 | 167.1 | 57.60 Memory usage (phys | virt): 413 | 514 MiB Thread count: 17 CPU usage (average): 79% Efficiency index: 0.7292 Prefetch(8): FPS (min | max | average): 14.93 | 4436 | 69.60 Memory usage (phys | virt): 527 | 628 MiB Thread count: 19 CPU usage (average): 95% Efficiency index: 0.7326 Prefetch(10): FPS (min | max | average): 15.04 | 158387 | 72.15 Memory usage (phys | virt): 654 | 756 MiB Thread count: 21 CPU usage (average): 99% Efficiency index: 0.7288 Last edited by Groucho2004; 21st June 2017 at 10:47. |
21st June 2017, 13:37 | #3462 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
Maybe this sse2 part was a bit overoptimized, because now I replaced it with something I could understand and it is giving the same result as classic Avisynth 2.6. I think using max thresholds (like QTGMC does) there is no problem with latest avs+ versions, I have put that special case in a separate optimized code path earlier. So expect a fix for this. And until then read this comment from Myrsloik. |
|
21st June 2017, 16:19 | #3464 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
There is no SetMemory. I'm using x86.
The only thing that comes into the log is Code:
INFO: LSMASHSource_LWLibavVideoSource() does not have any MT-mode specification. Because it is a source filter, it will use MT_SERIALIZED instead of the default MT mode. Here's the code, running on a 1080p source Code:
file="Female President.mp4" SetLogParams("log.txt", LOG_DEBUG) LWLibavVideoSource(file, cache=False) ConvertToYV12() FrameRateConverter(60) Prefetch(8) Code:
FPS (min | max | average): 1.157 | 101672 | 13.12 Memory usage (phys | virt): 1446 | 1451 MiB Thread count: 29 CPU usage (average): 52% Code:
FPS (min | max | average): 2.674 | 93538 | 18.11 Memory usage (phys | virt): 1423 | 1434 MiB Thread count: 29 CPU usage (average): 64% Code:
FPS (min | max | average): 3.096 | 97436 | 16.91 Memory usage (phys | virt): 1457 | 1465 MiB Thread count: 29 CPU usage (average): 63% Yes, the issue is in MvTools2 and should be tested on jm_fps. In my case, I can't fix performance by increasing threads (8 cores). 12 gives a slight performance increase, and 16 gives a performance decrease. and here's performance on a 1080p source with DCT=1 (preset="slow") Code:
FPS (min | max | average): 0.083 | 83516 | 0.484 Memory usage (phys | virt): 1168 | 1166 MiB Thread count: 26 CPU usage (average): 26%
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 21st June 2017 at 16:25. |
22nd June 2017, 12:38 | #3465 | Link |
Registered User
Join Date: Aug 2014
Posts: 39
|
I'm facing a problem with specific source VP9 file with single keyframe. FFMS2 cause error and Directshowsource change clip duration by few millliseconds and cause framecount to change, this is enough to audio come out of sync.
Code:
[avisynth @ 0358ba40] FFVideoSource: Out of bounds frame requestede=16629.7kbits/s speed=0.247x Unknown error occurred Code:
Duration: 00:02:02.56, start: -0.007000, bitrate: 11360 kb/s Stream #0:0(eng): Video: vp9 (Profile 0), yuv420p(tv), 1920x1080, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc (default) Code:
Duration: 00:02:02.12, start: 0.000000, bitrate: 0 kb/s Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc Code:
Input #0, avisynth, from 'GTA5 1600mhz low.avs': Duration: 00:02:02.59, start: 0.000000, bitrate: 0 kb/s Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc Encoding the video directly with FFMpeg cause no such issue. Last edited by chummy; 22nd June 2017 at 12:46. |
23rd June 2017, 08:26 | #3467 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
I checked your FramerateConverter git repository, the avisynth.h you're using does not have the fallback mechanism. Update to the latest headers and it will work correctly.
Last edited by Groucho2004; 23rd June 2017 at 13:49. |
23rd June 2017, 16:54 | #3468 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,823
|
Quote:
There'd probably be minor differences in the way the timing is rounded, as at 29.970fps (3000/1001) each frame has a duration of 33.366666_ ms. If my maths is correct your clip's duration should be 00:02:02.53.4666666 ms (at frame number 3658). I checked a clip with Avisynth using Info() and at frame 3658 it reports 00:02:02.55 ms. Maybe ffmpeg uses a slightly different pattern for rounding frames to the nearest ms. Try this: DirectShowSource("E:\video.mkv", audio=false, fps=29.970, convertfps=true).AssumeFPS(3000,1001) Or this: FFVideoSource("E:\video.mkv", threads=1, fpsnum=30000, fpsden=1001) |
|
23rd June 2017, 17:41 | #3469 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
FFVideoSource fpsnum/fpsden drops/adds frame though
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
23rd June 2017, 18:31 | #3471 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
If I were to guess, it looks like incorrect mutex locks preventing proper MT execution. |
|
23rd June 2017, 20:52 | #3474 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,823
|
So does convertfps=true for DirectShowSource, but if the frame rate is just a little off that might be enough to fix it (I've never understood why it isn't changefps=true for DirectShowSource, given it behaves the same ways as Avisynth's ChangeFPS).
chummy probably needs to add Info() to a script and preview the output to determine the frame rate and whether adding any sort of frame rate conversion would fix the audio sync. Assuming that's actually the problem. We don't know how chummy is extracting/muxing the audio or whether it's being converted etc. |
23rd June 2017, 21:19 | #3475 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Maybe the large temporal range and non-linear frame requests wreak havoc with the multi-threading. |
|
23rd June 2017, 22:52 | #3476 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
Or is it requesting frames in the wrong order or something? Perhaps something is getting mixed up in the buffers or something. |
|
25th June 2017, 02:50 | #3479 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Here's an interesting case.
Code:
file="1080p.mp4" LWLibavVideoSource(file, cache=False) Spline36Resize(Width/2, Height/2) FPS (min | max | average): 70.50 | 168.0 | 113.8 Memory usage (phys | virt): 108 | 105 MiB Thread count: 21 CPU usage (average): 25% Code:
file="1080p.mp4" LWLibavVideoSource(file, cache=False) Spline36Resize(Width/2, Height/2) Prefetch(8) FPS (min | max | average): 1.816 | 212585 | 42.70 Memory usage (phys | virt): 160 | 157 MiB Thread count: 29 CPU usage (average): 67% Code:
file="1080p.mp4" LWLibavVideoSource(file, cache=False) Spline36Resize(Width/2, Height/2) jm_fps() # Without Recalculate Prefetch(8) FPS (min | max | average): 1.844 | 101671 | 77.29 Memory usage (phys | virt): 650 | 648 MiB Thread count: 29 CPU usage (average): 71% replacing jm_fps with FrameRateConverter(60, Output="Flow") Code:
FPS (min | max | average): 3.539 | 129914 | 49.19 Memory usage (phys | virt): 956 | 955 MiB Thread count: 29 CPU usage (average): 60% Code:
FPS (min | max | average): 2.222 | 137555 | 33.69 Memory usage (phys | virt): 735 | 735 MiB Thread count: 29 CPU usage (average): 42% Here's the jm_fps function I'm using. Note: I did the test with super=superfilt line which isn't correct but that's how I ran the tests. Code:
function jm_fps(clip C) { Blksize=16 BlkSizeV=16 Dct=0 NewNum=60 NewDen=1 Recalculate = true Prefilter = C.RemoveGrain(22) superfilt = MSuper(prefilter, hpad=16, vpad=16) # all levels for MAnalyse super = superfilt #MSuper(C, hpad=16, vpad=16, levels=1) bak = MAnalyse(superfilt, isb=true, blksize=BlkSize, blksizev=BlkSizeV, overlap = BlkSize>4?(BlkSize/4+1)/2*2:0, overlapv = BlkSizeV>4?(BlkSizeV/4+1)/2*2:0, search=3, dct=Dct) fwd = MAnalyse(superfilt, isb=false, blksize=BlkSize, blksizev=BlkSizeV, overlap = BlkSize>4?(BlkSize/4+1)/2*2:0, search=3, dct=Dct) fwd = Recalculate ? MRecalculate(super, fwd, blksize=BlkSize/2, blksizev=BlkSizeV/2, overlap = BlkSize/2>4?(BlkSize/8+1)/2*2:0, overlapv = BlkSizeV/2>4?(BlkSizeV/8+1)/2*2:0, thSAD=100) : fwd bak = Recalculate ? MRecalculate(super, bak, blksize=BlkSize/2, blksizev=BlkSizeV/2, overlap = BlkSize/2>4?(BlkSize/8+1)/2*2:0, overlapv = BlkSizeV/2>4?(BlkSizeV/8+1)/2*2:0, thSAD=100) : bak Flow = MFlowFps(C, super, bak, fwd, num=NewNum, den=NewDen, blend=false, ml=200, mask=2, thSCD2=255) return Flow }
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 25th June 2017 at 02:59. |
27th June 2017, 08:47 | #3480 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
Adding avstp.dll to your plugin directory may improve things - or not. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|