Jump to content

ShareX settings for quick screen capture & sharing (a.k.a. time to ditch Gyazo)

adam10603

So I've been using Gyazo for a long time because of its ability to select a screen region, record a short video/gif, then have a link to it ready on my clipboard.

What Gyazo also does is it resizes your capture. If you capture your entire screen, it might be scaled down a lot, but a smaller region might not be.

 

I wanted ShareX to do the same thing, to finally replace Gyazo. It needed a lot of tweaking and custom FFmpeg flags, but I have something that works very well, so I thought I'd share it.

It produces much smaller files than GIFs too.

 

I use this a lot to quickly share short clips from higher bitrate recordings for example. I would play back gameplay footage, then grab a section with ShareX, and the results looks like this. Of course it's good for any quick screen capture that you'd use Gyazo for.

 

What this does:

  • You can easily share a short capture of your screen, custom region, window etc.
  • It automatically scales down captures (if needed)
  • It has decent file sizes (about 7MB for a 15-second gameplay clip)
  • No audio, but it's meant to replace GIFs so that's ok

 

How to set it up:

 

For easy sharing, select Gfycat as file uploader and enable Copy URL to clipboard in After upload tasks.

I suggest making a Gfycat account and linking it up as well, since then it'll keep all your captures in your account.

 

  1. Go to Task Settings -> Screen Recorder and set Screen Recording FPS to 30 (you can use 60 in the latest version too, but I suggest trying 30 first)
  2. Open Screen Recording Options and make sure you have FFmpeg available (if not, hit the Download button).
  3. Set Video source to screen-capture-recorder (if you don't see it, click Install recorder devices) and Audio source to none.
  4. Audio codec doesn't matter, but I have mine on AAC with the bitrate set to minimum (there's no audio anyway).
  5. Set up encoding in one of two ways:
      
    • For NVENC-capable GPU users (basically NVIDIA cards that aren't too old) I suggest using NVENC like so:
        
      • Set Video codec to H.264 NVENC (mp4)
      • Under the NVENC tab, set the Preset to slow (High quality 2 passes) and the Bitrate to 3500 (you can go higher for better quality, but file sizes will increase)
      • AFTER all the above is set up, check Use custom commands and locate the part where it says -pix_fmt yuv420p and replace exactly and only that part (preserving the spaces on either side) with the following:
        -vf "scale='iw*min(1,sqrt(1024*576/iw/ih))':'ih*min(1,sqrt(1024*576/iw/ih))':in_range=full:out_range=full:in_color_matrix=bt709:out_color_matrix=bt709" -sws_flags lanczos -profile:v high444p -pix_fmt yuvj444p -color_range 2

        (This is different from the x264 version, don't mix them up)

      • Here's how to paste it, just to be sure
          

    • To use x264 (CPU encoding) in case you want to, or don't have an NVENC-capable GPU:

      • Set Video codec to x264 (mp4)

      • Under the x264 / x265 tab, set CRF to 33 (this usually results in roughly 3000 to 4000kbps total bitrate. A lower number better quality, but file sizes will increase)

      • Set the Preset anywhere from Very fast to Medium. Slower presets are better quality but use much more CPU. Past Medium is unnecessary, below Very fast is bad quality.

      • AFTER all the above is set up, check Use custom commands and locate the part where it says -pix_fmt yuv420p and replace exactly and only that part (preserving the spaces on either side) with the following:

        -vf "scale='iw*min(1,sqrt(1024*576/iw/ih))':'ih*min(1,sqrt(1024*576/iw/ih))':in_range=full:out_range=full:in_color_matrix=bt709:out_color_matrix=bt709" -sws_flags lanczos -pix_fmt yuvj444p -color_range 2

        (This is different from the NVENC version, don't mix them up)

      • Here's how to paste it, just to be sure

      • Find the word zerolatency in the commands and replace it with grain (this results in better encoding quality)
          

  6. Exit the settings, open Hotkey settings then set a hotkey for Screen record -> Start/stop screen recording (NOT GIF) with your preferred method such as custom region, active window etc. for example like this.

 

That should be it! Hit your hotkey, capture something (I suggest using this for about 5 to 15-second captures), and it'll produce a small but decent GIF-like video, ready to paste its link anywhere.

 

Things to know:

 

If you wish to change some settings like bitrate in the Screen Recording Options, you'll have to disable Use custom commands first, make your change, then re-do the part where you paste my custom commands, or otherwise your changes might not apply.

 

If you're curious, the scaling works based on the total area of the capture. It checks if the capture has more total pixels than a theoretical 1024*576 image would have, and if it does, it will scale it down (while keeping its aspect ratio) to match the aforementioned pixel area, so think of it as an upper cap on the number of total pixels. This means for example that if you capture something twice as high but half as wide as the reference area, you will not experience any scaling at all, since the total area is still the same, so it's still just within the limit. To output larger resolutions, you can try replacing those numbers with for example 1280*720 or even 1920*1080, but a higher resolution has more compression at the same bitrate.

 

For the scaling algorithm I chose Lanczos which is my favorite for downscaling video. It produces a very natural looking picture as opposed to bilinear which is often too blurry, or bicubic which looks over-sharpened.

 

I chose to use 4:4:4 chroma subsampling, because even though it increases the compression needed a little bit, but especially at lower resolutions 4:2:0 looks terrible, so I think it's a worthy change. I also force full (0-255) range on the output video, for the least possible loss in quality.

 

I spent a lot of time fine tuning all of these settings so that it would produce good enough quality captures to replace Gyazo's GIFs but with a small enough file size. Of course feel free to change these values, but I think my settings are a decent middle ground that would work for a lot of people for random short screen captures to share.

 

Btw you could also just directly drag the video files into Discord to share, since even without Nitro, Discord has an 8MB upload cap, which would fit about 15 seconds worth of screen capture with this method.

 

 

I hope you found this useful, any feedback is appreciated of course!

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

Hi. I started using sharex and wanted to try something with OBS studio. I have the OBS virtual cam plugin installed, and selecting obs-camera as the video source works great with other programs like Zoom. However, in ShareX, when I select OBS-camera and OBS-audio as the video and audio sources in screen recording settings, it doesn't seem to record anything despite showing that it's recording- i.e. the file doesn't play anything in VLC just a blank screen. I also tried pasting the settings in your post (for Nvidia - I have gtx 760) hoping it might work; with these settings (made sure I pasted them correctly), it won't record anything and immediately stops, giving the task completion sound (and the file it generates doesn't display anything and has zero filesize this time). I saw that your post had something on the screen record function in ShareX and thought maybe you might know what's the problem. Any thoughts why it's not recording anything? I've attached a screenshot of the settings window if that helps.

ShareX_oNlWmq2Vs1.png

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 months later...

So I tried your settings exactly with both the CPU & GPU, but when I record something, the whole recording is just a black screen which doesn't play

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...
On 10/27/2018 at 1:56 PM, adam10603 said:

-vf "scale='iw*min(1,sqrt(1024*576/iw/ih))':'ih*min(1,sqrt(1024*576/iw/ih))':in_range=full:out_range=full:in_color_matrix=bt709:out_color_matrix=bt709" -sws_flags lanczos -profile:v high444p -pix_fmt yuvj444p -color_range 2

I know I'm necro-ing this thread... but I just wanted to let anyone looking at this know. I have a 1070 and I am running driver version 471.41 and this does not seem to work anymore, I tested using the "test with CMD" button right above where you paste in custom commands. I did manage to get it somewhat working by modifying:

 

On 10/27/2018 at 1:56 PM, adam10603 said:

high444p

to just "high444" as it was complaining about high444p being unsupported (at least on my 1070). So for me my custom commands ended up looking like this:
 

-rtbufsize 150M -f dshow -framerate $fps$ -i video="screen-capture-recorder" -c:v libx264 -r $fps$ -preset ultrafast -tune grain -crf 28 -vf "scale='iw*min(1,sqrt(1024*576/iw/ih))':'ih*min(1,sqrt(1024*576/iw/ih))':in_range=full:out_range=full:in_color_matrix=bt709:out_color_matrix=bt709" -sws_flags lanczos -profile:v high444 -pix_fmt yuvj444p -color_range 2 -movflags +faststart -y "$output$"


However, once I did that, when I ran the test again it seems to just fall back on to CPU encoding, as now 9% of my 2700x is now being used when I run the test... sigh... Oh well. If anyone else who is more experienced with ffmpeg would like to take a look at what is going on, here is a pastebin link to the output of the "Test with CMD button"

I did not test the CPU settings, but I have a feeling they may have the same issues as the nvenc settings. Good luck everyone else!

(Also I exported the settings I ended up with once I tinkered with it here just in case someone else would like to trouble shoot)

sharex-VideoCaptureSettings-Nvenc.json

Spoiler

Primary System: Big Rave
CPU: R7 2700x
Cooler: EK-AIO Basic 360
RAM: CORSAIR Vengeance LPX 64GB (4x16GB) DDR4 2400 CL14 (OC @2733Mhz)

Mobo: Asus ROG STRIX X470-F Gaming
GPU-1: Asus ROG STRIX GTX 1070 8G Gaming

Case: Lian Li PC-O11 Dynamic

Windows 10 Boot Disk: Samsung 970 EVO Plus 2TB

Ubuntu 20.04 Boot Disk: Samsung 970 EVO plus 500GB

Fans: Corsair LL120 RGB (x6)
PSU: EVGA BQ 850 W 80+ Bronze Certified


Secondary System: Razer Blade 15 (RTX)
CPU: i7-9750H

RAM: 16GB (Dual Channel, 2667Mhz)
GPU: RTX 2070 Max-Q
SSD: Samsung 970 EVO Plus 2TB

Display: 15.6 inch IPS - 240Hz

RGB: Glorious

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Guest
This topic is now closed to further replies.

×