Question / Help No matter what, encoded stream is always yuv420p and I want 422

t2k

New Member
I really need to encode in a format that does not sub-sample chroma across scanlines. I'm streaming raw interlaced 720x480 video and when 420 chroma sampling is used, the chrominance of adjacent lines are being blended together, which is resulting in video artifacts that is confusing the computer vision code processing the feed on the other end.

I'd like to configure obs to encode the video as yuv422p to solve this problem, but nothing I add to the x264 options helps

I've tried "--profile high422" and "--output_csp i422" separately and in combination, as well as "profile=high422" and "output_csp=i422" but ffprobe always reports that the stream is yuv420p

Any suggestions?

Thanks!
 

Waistless

New Member
There is another set of options within OBS studio within the Advanced section, there you can control color profiles i.e NV12, I420, YUV, RGB etc. I can check in an hour can't remember if there's an I422 option but there might be. Combining that with your h264 options should hopefully get it working.

I am curious as to the need to stream 480i rather than deinterlacing on the same machine, I assume there's a good reason :P (I guess NTSC broadcasting?)

edit: No I422 unfortunately, but RGB and I444 are both options.
 
Last edited:

t2k

New Member
Waistless:

I have tried the various deinterlacing options and unfortunately none really work perfectly with the analysis/scanning software that is processing the video downstream. Deinterlacing introduces its own artifacts, often blurring scanlines together (which is exactly what I'm trying to avoid by encoding 422 instead of 420). The Retro option works best, but still has problems which I think a straight 422 signal would avoid.

You can see what I'm working on here - https://www.twitch.tv/classictetris/v/94168110 . All the graphics there are generated from captured and analyzed video coming in from local NES systems. I'm trying to get this same system working with players in remote locations.

Schauerland:

I don't think I understand what you are suggesting. Can you provide more details?
 
under video settings change from nv12 to rgb (you have ether 4:2:0, 4:4:4 or rgb here, no 4:2:2 so if you want to have 4:2:2 you have to convert by yourself)

the under output settings use avdvanced, Recording-Type use custom output (ffmpeg)
container format mkv or mp4
video encoder libx264
video encoder settings: the settings of your choice e.g. preset=veryfast profile=high422 crf=18 keyint=300
audio encoder aac (and set the bitrate)

notice that with custom ffmpeg you can only record one audio track

the trick is now that the scene is in rgb so rgb > 4:2:2
if the scene is nv12 or I420 you already lost color information (you could also set 4:4:4 I444)

good luck
 

t2k

New Member
Thanks Schauerland but I need something that can be used for live streaming not just recording =)
 
Top