View Full Version : FFVideoSource + ProRes MOV now adding colored pattern?
Lyris
12th January 2017, 22:19
Hey forumers
I recently upgraded my version of FFvideosource (ffms2.dll). When I encode black and white masters I usually check for any stray junk in the Cb and Cr channels (some restoration tools introduce it) and turn saturation down to 0 if necessary.
I've found that since the upgrade, FFMS is doing this now:
ffvideosource("master.mov")
tweak(sat=20) #for testing
https://s27.postimg.org/8zb8m30hv/image.jpg
Whereas QTinput (which I believe truncates to 8 bit) doesn't have this problem;
qtinput("master.mov")
tweak(sat=20) #for testing
https://s27.postimg.org/afmr483er/image.jpg
Sorry I can't provide a sample or anything more than a non-descript patch of letterbox + gray.
Has anyone else come across this? Is it anything to worry about or just some kind of normal dithering function? Obviously tweak(sat=20) is cranking the saturation way up and has no other purpose, I'm just a little concerned of possible patterning being introduced into color content. That pattern isn't good compression...
For now I've just used tweak(sat=0) since the source is all B&W and it doesn't seem to have any side effects in the Y channel.
dipje
13th January 2017, 15:19
First of, isn't ffvideosource kinda old? Isn't ffms2() the new API?
Still. I found out that when ffms2 has to do colorspace conversion I get colorcasts in my Cineform and Prores files.
Even when I opened a rgbp12le Cineform file, which FFMS2() opened as RGB48 I tried to convert it to YUV 4:4:4 16bpp inside of ffms2, and I got similar color casts.
Just leaving the input alone and doing the conversion later in Vapoursynth (in my case) fixed it.
Since you're probably using 8bpp Avisynth or something ffms2 is converting the colorspace to go from 10bpp Prores to 8bpp. This causes the colorcast.
So, you must make sure you absolutely don't do any colorspace conversion inside of ffms2() call.
I'm guessing you do this by using Avisynth+ or Vapoursynth to let ffms2() return the unaltered yuv 4:2:2 10bpp (or yuv 4:4:4 10bpp), then using tools like the dither package of fmtconv or something to convert it to 8bpp outside of ffms2()
Lyris
13th January 2017, 18:14
First of, isn't ffvideosource kinda old? Isn't ffms2() the new API?
Whoops - must have missed that! Thanks for bringing me up to speed. It does the exact same thing, as you said.
Unless I specify:
ffms2("x.mov", colorspace="YUY2")
(or)
ffvideosource("x.mov", colorspace="YUY2")
in which case it's all good. Thanks for the pointer! Solved.
Groucho2004
13th January 2017, 18:23
First of, isn't ffvideosource kinda old? Isn't ffms2() the new API?ffms2() is nothing but a convenience alias for ffmpegsource2() which in turn calls ffvideosource().
dipje
13th January 2017, 20:55
Hmm.. basically what that did is forcing ffmpeg to scale / convert (what it told you to NOT do) but now it works OK for you. A clear case of 'whatever, it works for you, don't touch it' :P. Solved is solved.
@Groucho: Sort of, yeah. ffmpegsource2() was an .avsi script that combined two ffvideosource() / ffaudiosource() calls in older versions. I now use ffms2() to get just video but I don't have any .avsi anymore. So I think ffms2() is just an alias for ffvideosource, not ffmpegsource2() (since that wasn't a DLL function, but an included .avsi script).
And yes, it's nothing more than an alias but I thought the old ffvideosource() was removed in newer builds. Guess I was wrong.
You're absolutely right that it's just semantics.. I never claimed otherwise, but it's a good idea to push people to new writing styles every now and then :P.
Groucho2004
13th January 2017, 22:28
So I think ffms2() is just an alias for ffvideosource, not ffmpegsource2() (since that wasn't a DLL function, but an included .avsi script).
FFMpegSource2() is now a function exported by ffms2.dll and ffms2() is its alias:
extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit3(IScriptEnvironment* Env, const AVS_Linkage* const vectors) {
AVS_linkage = vectors;
Env->AddFunction("FFIndex", "[source]s[cachefile]s[indexmask]i[dumpmask]i[audiofile]s[errorhandling]i[overwrite]b[utf8]b[demuxer]s", CreateFFIndex, nullptr);
Env->AddFunction("FFVideoSource", "[source]s[track]i[cache]b[cachefile]s[fpsnum]i[fpsden]i[threads]i[timecodes]s[seekmode]i[rffmode]i[width]i[height]i[resizer]ss[utf8]b[varprefix]s", CreateFFVideoSource, nullptr);
Env->AddFunction("FFAudioSource", "[source]s[track]i[cache]b[cachefile]s[adjustdelay]i[utf8]b[varprefix]s", CreateFFAudioSource, nullptr);
Env->AddFunction("[COLOR="Red"]FFmpegSource2", "[source]s[vtrack]i[atrack]i[cache]b[cachefile]s[fpsnum]i[fpsden]i[threads]i[timecodes]s[seekmode]i[overwrite]b[width]i[height]i[resizer]s[colorspace]s[rffmode]i[adjustdelay]i[utf8]b[varprefix]s", CreateFFmpegSource2, nullptr);
Env->AddFunction("FFMS2", "[source]s[vtrack]i[atrack]i[cache]b[cachefile]s[fpsnum]i[fpsden]i[threads]i[timecodes]s[seekmode]i[overwrite]b[width]i[height]i[resizer]s[colorspace]s[rffmode]i[adjustdelay]i[utf8]b[varprefix]s", CreateFFmpegSource2, nullptr);
Env->AddFunction("FFImageSource", "[source]s[width]i[height]i[resizer]s[colorspace]s[utf8]b[varprefix]s", CreateFFImageSource, nullptr);
Env->AddFunction("FFCopyrightInfringement", "[source]s", CreateFFCopyrightInfringement, nullptr);
Env->AddFunction("FFGetLogLevel", "", FFGetLogLevel, nullptr);
Env->AddFunction("FFSetLogLevel", "i", FFSetLogLevel, nullptr);
Env->AddFunction("FFGetVersion", "", FFGetVersion, nullptr);
return "FFmpegSource - The Second Coming V2.0 Final";
}
dipje
13th January 2017, 23:01
Lol, that's just the script in C form.. I see the point :P
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.