FORUMS: list search recent posts

Resizing on render alters colors

COW Forums : VEGAS Pro

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Sandler
Resizing on render alters colors
on Mar 2, 2017 at 3:20:52 pm

Hello, guys.
I noticed that if I render clip in it's original size - it comes out exactly as source, but if I change resolution in becomes more redish.
Here is specs:
Source file:
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 9.06 GiB
Duration : 1 h 53 min
Overall bit rate : 11.4 Mb/s
Writing application : Lavf56.30.100

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 9 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 h 53 min
Bit rate : 11.3 Mb/s
Width : 1 280 pixels
Height : 694 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Variable
Frame rate : 23.976 (24000/1001) FPS
Minimum frame rate : 23.810 FPS
Maximum frame rate : 24.390 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.530
Stream size : 8.95 GiB (99%)
Writing library : x264 core 142 r2431+42 c69a006 tMod [8-bit@all X86_64]
Encoding settings : cabac=1 / ref=9 / deblock=1:-3:-3 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / fade_compensate=0.00 / psy_rd=0.80:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=18.0000 / qcomp=0.60 / qpmin=0:0:0 / qpmax=69:69:69 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=4:0.75 / aq-sensitivity=10.00 / aq-factor=1.00:1.00:1.00 / aq2=0 / aq3=0


Render settings:
Sony AVC internet template
Profile: High
Frame rate: 23.9
Bitrate: 25mbs
Field order: none (progressive)
pixel aspect: 1
Frame size: 1280:694 (<b>original</b>)


Project properties pixel format has to be 32bit to get original sized video to be exactly as source.

But if I change render Frame size to any other(correct 720p or 1080 or even 1920x1041) colors become more red or something. It is the same clip, same properties, same codec - everything is the same except frame size. I tried to play with levels, curves, and other color corrections - but still I can't get exact colors.


What am I doing wrong?


Return to posts index

Graham Bernard
Re: Resizing on render alters colors
on Mar 2, 2017 at 4:16:38 pm

For The purposes of comparisons, show us the MediaInfo for the non-red good media.

* Grazie

Video Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 + PowerShot SX50HS Bridge


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 2, 2017 at 4:53:55 pm

I have added image with color comparsion to first post but it did not come up. Here it is http://prnt.sc/ef4wvn

Here is data of correct video
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/isom)
File size : 2.82 MiB
Duration : 901 ms
Overall bit rate mode : Variable
Overall bit rate : 26.3 Mb/s
Encoded date : UTC 2017-03-02 13:42:59
Tagged date : UTC 2017-03-02 13:42:59

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.2
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Muxing mode : Container profile=High@4.0
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 901 ms
Bit rate mode : Variable
Bit rate : 26.0 Mb/s
Width : 1 280 pixels
Height : 694 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.977
Stream size : 2.81 MiB (99%)
Language : English
Encoded date : UTC 2017-03-02 13:42:59
Tagged date : UTC 2017-03-02 13:42:59


here is resized video(it just added black bars)

Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/isom)
File size : 2.82 MiB
Duration : 901 ms
Overall bit rate mode : Variable
Overall bit rate : 26.2 Mb/s
Encoded date : UTC 2017-03-02 13:43:26
Tagged date : UTC 2017-03-02 13:43:26

Video
ID : 2
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.2
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Muxing mode : Container profile=High@4.0
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 901 ms
Bit rate mode : Variable
Bit rate : 26.0 Mb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.941
Stream size : 2.80 MiB (99%)
Language : English
Encoded date : UTC 2017-03-02 13:43:26
Tagged date : UTC 2017-03-02 13:43:26



Tried the same thing in Adobe Premier with H264 codec and there is not color change during resizing.
And here is specs of AP video file
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/mp41)
File size : 106 MiB
Duration : 1 min 23 s
Overall bit rate mode : Variable
Overall bit rate : 10.7 Mb/s
Encoded date : UTC 2017-03-02 16:45:48
Tagged date : UTC 2017-03-02 16:45:49
©TIM : 01:41:54:16
©TSC : 24000
©TSZ : 1001

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Format settings, GOP : M=4, N=23
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 min 23 s
Bit rate : 10.4 Mb/s
Width : 1 280 pixels
Height : 694 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.487
Stream size : 103 MiB (97%)
Language : English
Encoded date : UTC 2017-03-02 16:45:48
Tagged date : UTC 2017-03-02 16:45:48
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709


Return to posts index


Adam Sandler
Re: Resizing on render alters colors
on Mar 2, 2017 at 4:55:53 pm

Video details provided my Media Player Classic HC
I use clean install of k-lite mega codec pack


Return to posts index

Richard Jones
Re: Resizing on render alters colors
on Mar 2, 2017 at 6:25:58 pm

The k-lite package might be the source of the problem! Many, many people have complained about the conflicts it creates and is difficult to uninstall.

Richard


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 2, 2017 at 8:55:47 pm

I don't see how that urban legend can affect all codecs my Vegas 13 using. Moreover there are tons of threads where Vegas alters colors, and probably zero threads where k-lite pack was proven guilty on something.


Return to posts index


Marco Baer
Re: Resizing on render alters colors
on Mar 2, 2017 at 10:24:20 pm

You should try disabling GPU support in both Options/Preferences/Video and in your render settings. GPU boost could cause strange trouble (though I wouldn't get too far from K-Lite as troublemaker).


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 2, 2017 at 11:13:03 pm

[Marco Baer] "You should try disabling GPU support in both Options/Preferences/Video"

Well, that did not fix color issue, but surprisingly it fixed other non related issue, where .avi Lagarith encoded clip that was above some other clip suffered from strange 10px wide vertical transparent line flicking every few frames. http://prntscr.com/efbfye

I found almost optimal Level FX values(1.050 green gamma 0.900 green input end and 1.050 red gamma) that almost matches source, but still looking for proper fix for color issue.


Return to posts index

Marco Baer
Re: Resizing on render alters colors
on Mar 2, 2017 at 11:41:47 pm

That color drift is really strange.

Do you see same drift if using a technical color bar (like the ones provided in the Vegas Media Generators) if using same size and applying same resizing?

Or could you offer a sample project with an small media file which for download for testing purpose?


Return to posts index


Adam Sandler
Re: Resizing on render alters colors
on Mar 3, 2017 at 12:08:34 am

I just used virtual windows 7 machine, no codecs whatsoever installed. Installed vegas 13. Imported mp4 file that vegas did on his own(with it's own codecs), rendered 1280x694 file which is correct copy of source file.
Rendered with sony avc internet template as
1280x694 - no color change
1280x720 vegas cropped and zoomed image (adjust source media to project settings) - colors shifted
1280x720 with black bars ( unchecked adjust smtps) - colors shifted
1280x720 with black bars and 32bit pixel format ( unchecked adjust smtps) - colors shifted.

It is not K-lite codec pack.


here is sample video I try to resize
https://www.sendspace.com/file/2xflqm


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 3, 2017 at 2:02:29 am

I run few test with SMPTE ntsc color bars
On new project with default settings 1920x1080. GPU acceleration off.
sony avc codec internet preset.
Final .mp4 opened MPC-HC and I saved screenshot from player into .bmp file and used photoshop pipette tool to check color numbers.

All standard HD frame sizes 720 1440 1920 - all look good. Red is 190 0 0, green is 0 190 0. All looks good.

Standard Non HD resolutions(like 640x480) have minimal fluctuations like red 190 1 0 or green 0 188 0 - seems okayish

Non standard resolution like 1280x694 - red 206 17 0 green 0 160 0 blue 0 11 197
or 1564x694 red 206 17 0 green 0 160 0 blue 0 11 197
random 888x666 red 206 17 0 green 0 160 0 blue 0 11 197

however another random 1256x576 gives proper colors with minimal fluctuations like red 190 1 0 or green 0 188 0 - seems okayish
and 888x720 gives 190 0 0 - clean rgb.


So it is something with how codec works with non standard Height size.


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 3, 2017 at 3:22:28 am

I came up with interesting results
sony's avc codec does good with source resolution, poorly with non source, and medium with level FX on non source resolution.
Mainconcept avc codec does poorly with source and non source resolution, but good on both with the same level FX adjustments, and takes up to 10 times longer to render final video.
I made compaction on picture. bad position adjustment made deliberately to make difference more visible.


How to do things without dancing around?


Return to posts index


Graham Bernard
Re: Resizing on render alters colors
on Mar 3, 2017 at 4:20:55 am
Last Edited By Graham Bernard on Mar 3, 2017 at 4:22:48 am

[Adam Sandler] "How to do things without dancing around?"
Adam, I have to say, you've produced some of the best, if not THE best analytical, evidenced-based results on this Forum for many a long year.Well done and thank you for your effort.

* Grazie

Video Content Creator and Potter
PC 7 64-bit 16gb * Intel® Core™i7-2600k Quad Core 3.40GHz * 2GB NVIDIA GEFORCE GTX 560 Ti
Cameras: Canon XF300 + PowerShot SX50HS Bridge


Return to posts index

László Kovács
Re: Resizing on render alters colors
on Mar 3, 2017 at 8:53:14 am

Without being completely sure (as you use a pixel format I never do), for your problem I would blame the black you added around the original video.
If you encode to an mpeg-like codec, there are the "legal" levels (16-235), which don't make problem.
When the levels are outside of this range (say they are "illegal"), the encoder may produce wrong results, which also may fool the decoder later - how wrong it is, depends on the encoder itself, I think.
So simple said, codecs, like wmv or lagarith expect computer RGB range (0..255), while mpeg-like codecs used in video industry expect studio RGB range (16..235).
So if you added that black as RGB (0,0,0) be it better RGB (16,16,16).
OR, alternatively add the levels FX to the video output with the preset 'computer rgb to studio'.
(If you do this, remember to add the reverse of the same effect to your source media: levels (studio-to-computer), otherwise the colors and the contrast of the source will look a bit washed out)
Again, I mean this with 8bit pixelformat.

I also noticed, that Mainconcept AVC encodes way much faster if there's no "illegal" level on its input.

Best regards

László Kovács


Return to posts index

Marco Baer
Re: Resizing on render alters colors
on Mar 3, 2017 at 10:50:12 am

"Imported mp4 file that vegas did on his own(with it's own codecs), rendered 1280x694 file which is correct copy of source file. Rendered with sony avc internet template …"

I tried same now (in an 8 bit project because using 32 bit floating point full level linear doesn't make too much sense here). I ran the test twice, one time with Vegas Pro 13, one time with Vegas Pro 14. One time cropped and zoomed to adjust source media, one time untouched - with black bars.
But in none of the cases I can cause such a color shift. I analyzed the colors via several control instruments and the colors are same.

Did you also check the rendered results inside Vegas Pro with its internal preview?


Return to posts index


Adam Sandler
Re: Resizing on render alters colors
on Mar 3, 2017 at 4:41:21 pm

[Marco Baer] "Did you also check the rendered results inside Vegas Pro with its internal preview?"

Well, I just did what you told - both normal and resized&color shifted clips looks identical in vegas preview window(sony and maincpt), but differently in MPC_HC VLC Quicktime.
I did test twice, second time in virtual machine without any additional codec packs installed - result is the same - clips identical in vegas and different in windows media player.

Also clips look differently in Adobe Premier.

retried experiment in Vegas 11 32bit - it does colorshift with mainconcept source and resized size, and with sony codecs during resizing, however in vegas preview window those clips look identically except maincopts source size clip (it's colorshifted)

wtf


Return to posts index

Marco Baer
Re: Resizing on render alters colors
on Mar 3, 2017 at 6:04:52 pm

Then it is very likely it's the players which decodes the files differently while the files actually all have same color. Besides different players use different video level management, some also interpret different color spaces. And what your demo pictures above show, really looks like a color space decode mismatch.

I only wonder why this happens. It may be the players take their color space base from the frame size and e.g. they use rec. 601 for any size below1280x720 and rec. 709 for sizes of 1280x720 and above.

Curious whether the differences of your renders adapt to the differences of rec. 601 and rec. 709. I'll do some tests later.


Return to posts index

Marco Baer
Re: Resizing on render alters colors
on Mar 3, 2017 at 6:35:02 pm

I'd say: Bingo, that's it (the false interpretation of color space by the players).

If you do a 709-to-601 channel blend conversion in Vegas Pro to your original sized footage, colors look exactly same.
Or –
If you do a 601-to-709 channel blend conversion in Vegas Pro to your resized footage, colors look exactly same, too.

So the easiest way for you to correct in a way the players will work as expected, is to pre-correct via an appropriate channel blend ajustments (I'm struggling through my brain getting the right order – I think your pre-correction then should be a 709-to-601 correction).


Return to posts index

Marco Baer
Re: Resizing on render alters colors
on Mar 3, 2017 at 6:59:34 pm

Aaarrgghh – vice versa.

Original size: 601-to-709 corrected
Resized: 709-to-601 corrected

And pre-correction probably: 709-to-601


Return to posts index

László Kovács
Re: Resizing on render alters colors
on Mar 3, 2017 at 6:06:37 pm

And what happens if try to feed only with 16..235 the mainconcept encoder?
Put a solid black [16,16,16] in a track below your movie, do that resize then, and repeat the color shifting test.
Side note: in Vegas preview where you see a black in an empty space, it's not really a black but a tranparent (which results in pure black if nothing below, but that transparent is not affected by FX levels on output...

Best regards

László Kovács


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 3, 2017 at 7:22:42 pm

[László Kovács] "Put a solid black [16,16,16] in a track below your movie, do that resize then, and repeat the color shifting test."



no dice. However, it really did speed up mainconcept encoding time!


btw I did test with other video with 1920x820, resized different ways and did not find color shifting.


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 4, 2017 at 12:53:32 am

.vmw vmv9 codecs deliver absolutely correct colors without fx adjustments on every resolution but makes picture blurry. 🙀🙀 what a joke


Return to posts index

Adam Sandler
Re: Resizing on render alters colors
on Mar 4, 2017 at 11:51:28 pm

None of your suggestions helped, guys. However I managed to get proper resized picture through VP+frameserver+virtualdub. I am new to encoding and had to try again and again.

Here is what I did.

Project had to be 32bit.

frameserver transport set to YUY12.

First I tried Lagarith lossless codec in default RGBA mode - it got me colorshifted video. Then I switched to YV12 - It made perfect color video. Then I tried to resize with leterbox - color stayed the same, but for some reason it blurres just a bit picture - sharpness filter fixes the problem however. Why does it do blur in first place?

Finally I found x264 codec with default settings( it converts to YUV 4.2.0 by default) - It gives perfect resized and non resized picture.

Let's say problem is solved, but I would like someone to summarize new information and answer why vegas's default codecs act so weird - maybe there is some way to render that video in vegas properly with sony avc or mainconcept? Also not that source file is 1280x694 and might be it adds up to problem, some algorithm might be bugging as of because If want to resize image without letterbox and keep the aspect it gives 1920x1041 - codecs round up it to 1920x1042.



By the way I found out vegas can do x264, so frameserver is not needed, however virtual dub has superior sharpness filter.


Return to posts index

Dan Harlow
Re: Resizing on render alters colors
on Mar 14, 2017 at 1:46:15 pm

x264 has parameters to specify whether the input is BT601 or BT709. This information is stored in the bitstream, allowing players to render the video with correct colors. This works with most players.

If the colorspace isn't specified, then players will guess it based on frame size (cutoff point usually is 720p).


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]