View Single Post
Old 12th June 2019, 04:39   #1  |  Link
orion44
None
 
orion44's Avatar
 
Join Date: Jul 2007
Location: The Background
Posts: 307
RGB to YV12 video encoding - colors are off...

I recorded a game with MAME's native recorder. The output video (sf2.avi) is in the following format:

Quote:
Video
ID : 0
Format : RGB
Codec ID : 0x00000000
Codec ID/Info : Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples
Duration : 26 min 43 s
Bit rate : 118 Mb/s
Width : 384 pixels
Height : 224 pixels
Display aspect ratio : 1.714
Frame rate : 59.610 FPS
Bit depth : 8 bits
Bits/(Pixel*Frame) : 23.039
Stream size : 22.1 GiB (95%)
I then used avisynth:

Quote:
AVISource("D:\Project\sf2.avi", audio=false)
PointResize(960,720)
to encode with x264:

Quote:
x264 --profile high --level 3.2 --preset slow --pass 1 --stats D:\Project\stats.log --bitrate 1000 -I 600 -i 60 -o D:\Project\1stPass.mkv "D:\Project\AviSynth Scripts\AVISource.avs"
x264 --profile high --level 3.2 --preset slow --pass 2 --stats D:\Project\stats.log --bitrate 1000 -I 600 -i 60 -o D:\Project\2ndPass.mkv "D:\Project\AviSynth Scripts\AVISource.avs"
pause
During the encoding, I got the following warning:

Quote:
resize [warning]: converting from bgr24 to yuv420p
The x264 encoded video has colors which are slightly off.

Example:

Screenshot taken directly from game. Looks good:

http://u.cubeupload.com/ClearSky/2ma...6102241334.png

Screenshot taken from AviSynth script above. Looks a bit lower quality, but colors are the same.

http://u.cubeupload.com/ClearSky/3FromVideo.png

Screenshot taken from final x264 encode. Red color is slightly off:

http://u.cubeupload.com/ClearSky/3fu.png

Is this color conversion normal, the way it should be, or is there a way to fix this?

Thanks.

Last edited by orion44; 12th June 2019 at 04:43. Reason: clarification...
orion44 is offline   Reply With Quote