Recently i started to pay attention around quicksync/NVENC colors since i use they sometimes to record gameplay and yet to encoding some footage wtih FFMpeg.
What i see is than apparently they have limited colormatrix around softwares. Shadowplay which is NVIDIA own recorder tag video file with BT.601 even for HD recording. OBS for example give options to use BT709 with NVENC if desired or 601 but it dont work. In OBS even using BT709 or BT601 for NVENC it output same colors but they are tagged differently. OBS NVENC bt709/BT601 tagged files has same colors than Shadowplay bt601 tagged file.
Another issue recently i tried to convert some bt601 files with FFMpeg Quicksync but it always convert to bt709 and looks like bt601 is not supported with Quicksync there. With NVENC i was successful converting bt601 footage with FFMpeg.
I use MPC-HC to watch footage so i dont know if its convertin wrong colors. My Hardware is First gen Kepler and Haswell quicksync.
The biggest issue is with MSI Afterburner which output wrong colors for both QS/NVENC, it dont looks same to any other recorder bt601/bt709.
+ Reply to Thread
Results 1 to 30 of 32
-
-
Can you post the ffmpeg log? I would think ffmpeg's filtering would do conversions to YUV (if required) and thus be in your full control. See "scale" filter options.
I recommend using madvr renderer. Then press ctrl+j to see its OSD. It will tell you about what color it thinks the source has. -
I don't understand. What exactly should I be looking at? They look identical to me.
-
Yes they look same but each recording software tagged the color differently. If you look madvr guess color it say bt601 for the shadowplay one and bt709 for the other. So what color is the correct one. Who is tagging it wrong, i guess its bt709 right? So Shadowplay is tagging it wrong..
Edit: People complain about Shadowplay 601 for NVIDIA for ages in their forums but apparently the colors are bt709, only tagged wrongly. -
Both are tagged correctly.
If you use 709 to view your obs sample, it looks the same as 601 to view the Shadowplay example
The problem occurs when someone uses software that ignores flags; for example if a player assumed since the shadowplay was "HD" and used 709, the colors would appear "wrong" -
Both videos are flagged correctly. The rec.601 video has rec.601 colors, the rec.709 video has rec.709 colors. If your player plays them properly the will both look the same on-screen. Some players ignore the colormatrix flag and always use one matrix or the other.
-
So is same as color range, it only show different colors when guessed wrongly. I thought bt601 and bt709 has different colors, there is some old color graph around web which shows bt601 with different colors than bt709, i guess this is wrong then.
Edit: How i do to determine the colormatrix from not tagged file? Is there a way?
Then in OBS NVENC is only one working properly. Quicksync dont tag file and recording with bt709 and bt601 give different color results. Same happens to x264.Last edited by chummy02; 26th Jun 2017 at 12:31.
-
-
Your game is running in RGB. But for video codecs it is common to store as YCbCr instead of RGB. When RGB is converted to YCbCr a colormatrix is used (simplified).
Software A converts from RGB to YCbCr using BT.601 and flags the file as BT.601.
Software B converts from RGB to YCbCr using BT.709 and flags the file as BT.709.
Both are correct. Neither is wrong. What you are seeing on your display is the conversion back from YCbCr to RGB. Not the stored values. -
qsvenc allows you to specify the colormatrix. From the docs:
Code:--colormatrix <string> undef, auto, bt709, smpte170m, bt470bg smpte240m, YCgCo, fcc, GBR default: undef --colorprim <string> undef, auto, bt709, smpte170m, bt470m bt470bg, smpte240m, film default: undef --transfer <string> undef, auto, bt709, smpte170m, bt470m bt470bg, smpte240m, linear, log100, log316 default: undef
-
yes, rigaya's qsvencc can specify the flags, but ffmpeg's qsvenc cannot (it will be left unflagged, which might be ok in some situations)
But rigaya's qsvencc cannot do a colormatrix conversion , but ffmpeg can (ideally you'd probably want to convert 601=>709 for HD if you were re-encoding it)
You can pipe ffmpeg with -vf scale or -vf colormatrix to convert 601=>709 , into qsvencc but I don't think take multiple stream inputs (no audio if piping) . I guess you could make script with temp files, and delete them with ffmpeg/mp4box/mkvmerge to mux the audio
Alternatively, keep it 601 and flag it 601 with qsvencc only (--avqsv can keep the audio as stream copy) , but I wouldn't do that. HD should be 709
Or use a 2nd tool to "patch" the flags after ffmpeg's conversion, like roozhous ffmpeg buildLast edited by poisondeathray; 26th Jun 2017 at 13:31.
-
Scale dont tag files, only way i find to tag files is using the command i show and that is only for x264 or NVENC in FFMpeg.
QSVenc and NVEnc are the most advanced in implementation, i know, but since i used for batching AVS scripts with audio support FFMpeg was my preference.
Thanks for all support and explanations. -
Even if not you could control the conversion to BT.709 for HD. Since basically every player assume HD to be BT.709 then you won't have any problems even without explicit flagging.
(If the lib exposes colormatrix setting maybe ask ffmpeg team for feature?) -
Last edited by chummy02; 26th Jun 2017 at 15:51.
-
I made a colorbar generator for exactly this purpose. It's called FRAFS Test Pattern.
You record a few seconds of this output:
[Attachment 42112 - Click to enlarge]
(text added to point out all the little extra features)
Observe the playback. If your playback decoding does not match OBS's encoding, the colors will be shifted (as in your image above) or the levels will be wrong.
The correct levels for each bar are marked in the output, so you can screen-grab your playback, open the image in a paint editor, and check to see if the values are correct. You can also skip the paint editor and probe screen colors directly with a tool such as the free ColorPic. -
I just done some encoding tests with "scale range" for Afterburner sources. It's encoded with bt601 for HD but is not tagged for both colormatrix or color range. For colormatrix its already fine but for color range i tried 4 conversions to check.
in=PC: out=PC
in=PC: out=TV
in=TV: out=TV
in=TV: out=PC
PCtoTV and TVtoPC conversions give same color output but for PCtoPC and TVtoTV the color get brighter and darker respectively.
I dont get the point why colors differ in PCtoPC and TVtoTV. TVtoTV is the one which looks same to OBS, NVIDIA colors.
When i dont know the color range from a input, should i guess input range to ffmpeg or can i only give output range and it will convert properly?
Edit: Just to be clear i doing a colormatrix conversion from 601 to 709 and want to do the correct color range conversion. If i keep bt601 range value results differs from if i convert colormatrix to 709.Last edited by chummy02; 27th Jun 2017 at 10:10.
-
yes -vf scale=in_color_matrix=bt601
ut_color_matrix=bt709 looks wrong on your sample for some reason
-vf colormatrix=bt601:bt709 looks correct
Or you can do in the avs script since you're doing this with batch avs -
colormatrix works but can produce banding.
zscale filter seems to be good (with activated dither) -
-
You do realize ffmpeg has a documentation, right?
https://ffmpeg.org/ffmpeg-filters.html#zscale
-vf zscale=matrixin=470bg:matrix=709:dither=ordered -
Yes i know. I tried first some times, but i get "strange" results so i wanted to be sure. Zscale caused a negligible change in colors green, blue and magenta which i dont noticed with colormatrix conversion. So i wanted to be sure i done correctly.
Thanks. -
To me colormatrix looks worse. But it's not a lossless procedure and it's difficult content.
-
So using MSI Afterburner for recording i noticed than with NVENC and Quicksync it was producing some chroma loss for some specifc areas like tiny lines, i dont know the correct term to define this issue. I then reencoded some UTvideo and MAgicYUV sources with FFMpeg NVENC and noticed it produced same chroma losses than occured in Afterburner.
I get a OBS NVENC source which dont have such issue. I encoded the OBS NVENC source with FFMpeg nvenc and Rigaya nvenCc. So FFMpeg produces some chroma shift while Rigaya keeps it more accurately. -
Almost like interlaced chroma, or some chroma aliasing. You probably used the wrong settings, or weren't using -pix_fmt nv12 for ffmpeg nvenc . If you look at the console log, rigaya's nvencc automatically converts to nv12
See this post and screenshots
https://forum.videohelp.com/threads/383320-So-what-s-the-status-on-hardware-accelerate...ng#post2484298Last edited by poisondeathray; 5th Jul 2017 at 20:19.
Similar Threads
-
quicksync via ffmpeg
By vhelp in forum Newbie / General discussionsReplies: 16Last Post: 21st Feb 2017, 00:43 -
How to enable Intel Quicksync encoding?
By videobruger in forum Video ConversionReplies: 6Last Post: 13th Nov 2015, 12:32 -
Colormatrix Question
By tebugg in forum Authoring (DVD)Replies: 3Last Post: 9th Oct 2014, 18:42 -
Color Issues in h.264 with different encoders and hardware acceleration
By rationalhippie in forum Video ConversionReplies: 2Last Post: 26th Dec 2013, 20:12 -
Handbrake support for Intel Quicksync
By glenpinn in forum Video ConversionReplies: 5Last Post: 8th Jan 2013, 04:35