should generally be 0 if scanlines are enabled V_PX_BLUR 12 Vertical pixel blur factor (% of pixel height). H_PX_BLUR 50 Horizontal pixel blur factor (% of pixel width) OVL_BRIGHTFIX 2.05 Brightness multiplier applied after color overlay. OVL_SCALE 0.08 Scale factor for shadow mask image OVL_TYPE triad Shadow mask (phosphor overlay) type, e.g. See FFmpeg Scaler Options for all available values triad shadowmask, 'gauss' for slot/grille (reduces OFILTER lanczos Output scaling filter recommended: 'lanczos' for OMARGIN 8 Minimum width of included margins (edge padding) OY 1080 Output height (width will be set to height*4/3) Larger factors = slower processing, better quality Input pre-scaling + aspect ratio adjustment:. 320x200), double the values for SX and SY, and set scanned (such as DOSBox produces with machine=vgaonly), e.g. This example is intended for low-res VGA input which has already been double. FFmpeg CRT script config file (comments start with a semicolon) Here's one so you can get a feel for what you can tweak: #FFMPEG SCALE VGA VIDEO TO 720P DOWNLOAD#The download includes a few config files to start you out. If you like such things, FFmpeg can pull them off quite well, so you can always have a go at adding to the script. The configFile argument specifies the configuration file, which is where you tune the simulation options: scaling, shadow-mask parameters, pixel blur, halation (the diffuse glow caused by scattering/reflection effects), scanline profile, beam bloom (where brighter pixels make the scanline appear wider), surface curvature (convexity), corner radius, and vignette (the darkening towards the edges of the CRT surface).Īll these elements characterize the normal output of a functional tube display - I tried to stay away from "aesthetic revisionism", so you won't find things like noise, chromatic aberration, ghosting, fake flicker/beam trail, sync errors and other 'glitch' visuals. #FFMPEG SCALE VGA VIDEO TO 720P HOW TO#More info on how to do this optimally will come in a future post. Specifically, the exact FFmpeg parameters are -c:v libx264rgb -crf 8 (all intermediate steps use -crf 0 for their temporary files, to keep things lossless).įor better compatibility with editing apps, and better color reproduction on video sharing and streaming services, you might want to convert the result to a YUV color space yourself. If FFmpeg returns an error at any point, the script aborts without deleting the temp files, since they may help with debugging.įor video, keep this in mind: the output will always be in the RGB colorspace / pixel format, because these scripts assume RGB input and attempt to preserve the color information. You'll see some temporary files being created during the run ( "TMP*"), but unless something goes wrong, the script cleans up after itself when it's done in fact all files starting with "TMP" in the current directory will be deleted, so try not to have any. If the output filename is omitted, the script will use the same name as the input appended with "_OUT". The Youtube video sample will show you the effect in motion, but here are a few still-image results at a higher resolution: Which includes everything you'll need, except for FFmpeg itself of course. #FFMPEG SCALE VGA VIDEO TO 720P WINDOWS#This script (a Windows batch file only, at least for now) will let you perform a CRT transform on an image or a video of the original-resolution material. If you know of a way around these shortcomings, that'd be nice to know.) #FFMPEG SCALE VGA VIDEO TO 720P PORTABLE#(FFmpeg can also be told to use the GPU, but not for everything - also, its GPU acceleration isn't portable and doesn't seem to make things very much faster, anyway. Of course, there are a ton of shaders for use in your favorite emulator which do it on the GPU in real-time, but I don't know of a decent way to just apply them to a stand-alone image or video file without tearing your hair out. I'm not kidding about "slow" - if you actually want to apply this to a video of more than a few seconds, in good quality, prepare to be outpaced by a glacier running a marathon through molasses. That's mostly due to the speed of doing this all on the CPU. You won't get much serious use out of this, even if we pretend that there is such a thing as "serious use" for simulating CRT monitors. This is just a fun little experiment which I've been tinkering with here and there lately.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |