I'm using AVISynth and I only just discovered that there was an "Average" option for the YV12 ColorMatrix setting. I love the way the color turns out while using it. The problem is, when using it on an HD MP4 file, I get massive slowdown.
Is there a way to fix this at all? The temporary solution is just downsizing it to 640 or 720. I understand if this filter just can't handle HD video at all.
+ Reply to Thread
Results 1 to 8 of 8
-
-
Groucho2004Guest
-
If smike means to say ConvertToYV12(matrix="average")...
There's normally no speed difference between color matrices, but looking into the source code,
I was a little surprised to see that calling ConvertToYV12 with no arguments invokes a faster routine:Code:http://avisynth2.cvs.sourceforge.net/viewvc/avisynth2/avisynth/src/convert/convert.cpp...ew=markup#l307 AVSValue __cdecl ConvertToYV12::Create(AVSValue args, void*, IScriptEnvironment* env) { PClip clip = args[0].AsClip(); const VideoInfo& vi = clip->GetVideoInfo(); if (vi.IsYUY2() && !args[3].Defined() && !args[4].Defined() && !args[5].Defined()) // User has not requested options, do it fast! return new ConvertToYV12(clip,args[1].AsBool(false),env); return ConvertToPlanarGeneric::CreateYV12(args,0,env); }
But not by very much, or someone would have complained before now eh?
I haven't noticed a "massive slowdown."Last edited by raffriff42; 11th Nov 2016 at 07:29. Reason: 'looking into the source code'
-
Groucho2004Guest
Did some testing with AVSMeter:
Script:
Code:colorbars(width = 1920, height = 1080, pixel_type = "rgb32").killaudio().assumefps(25, 1).trim(0, 1999) #converttoyv12() #or #converttoyv12(matrix = "average")
Code:[Runtime info] Frames processed: 2000 (0 - 1999) FPS (min | max | average): 122.2 | 128.0 | 127.2 Memory usage (phys | virt): 402 | 400 MiB Thread count: 1 CPU usage (average): 25%
Code:[Runtime info] Frames processed: 2000 (0 - 1999) FPS (min | max | average): 122.3 | 128.0 | 127.3 Memory usage (phys | virt): 402 | 400 MiB Thread count: 1 CPU usage (average): 25%
-
My mistake, It's "ConvertToYV12" Matrix. Going back through my script, the slowdown comes from using that, in conbination with a ConvertToRGB Matrix setting.
Like I said, I like the picture it produces, but I don't think that those two options together can handle an HD MP4.
-
-
Script
LoadPlugin("C:\Users\#####\Documents\#####\ffms2.d ll")
Import("C:\Program Files (x86)\AviSynth\plugins\FFMS2.avsi")
AudioDub(FFAudioSource("TOSP.mp4"),FFVideoSource(" TOSP.mp4",threads=1))
#SincResize(640,480)
ConvertToRGB(matrix="PC.709")
ConvertToYV12(matrix="AVERAGE")
MediaInfo
General
Complete name TOSP.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 818 MiB
Duration : 24mn 15s
Overall bit rate mode : Variable
Overall bit rate : 4 716 Kbps
Encoded date : UTC 2016-08-03 08:59:18
Tagged date : UTC 2016-08-03 08:59:26
©TIM : 00:07:20:15
©TSC : 25
©TSZ : 1
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 24mn 15s
Bit rate : 4 372 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.084
Stream size : 759 MiB (93%)
Language : English
Encoded date : UTC 2016-08-03 08:59:18
Tagged date : UTC 2016-08-03 08:59:18
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 24mn 15s
Source duration : 24mn 15s
Bit rate mode : Variable
Bit rate : 317 Kbps
Maximum bit rate : 420 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Delay relative to video : 40ms
Stream size : 55.1 MiB (7%)
Source stream size : 55.1 MiB (7%)
Language : English
Encoded date : UTC 2016-08-03 08:59:18
Tagged date : UTC 2016-08-03 08:59:18 -
Maybe it makes only a tiny bit of difference here but, for fastest results you're supposed to list the video first when using AudioDub.
Unless you need the audio, try running your script without it:
FFVideoSource(" TOSP.mp4",threads=1)
ConvertToRGB(matrix="PC.709")
ConvertToYV12(matrix="AVERAGE")
And it seems silly to me to use ColorMatrix just because you 'like the picture it produces'.
Similar Threads
-
MP4 to see on pc have to be colormatrix 601?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 25th Mar 2015, 21:15 -
avisynth: how to apply colormatrix to vid=FFVideoSource?
By marcorocchini in forum Newbie / General discussionsReplies: 3Last Post: 25th Mar 2015, 11:04 -
Colormatrix Question
By tebugg in forum Authoring (DVD)Replies: 3Last Post: 9th Oct 2014, 19:42 -
how to change colormatrix in MEncoder?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 2nd Nov 2013, 15:00 -
setting the correct colormatrix in x264
By codemaster in forum Video ConversionReplies: 1Last Post: 2nd Mar 2012, 23:14