Introduction
As I became more accustomed to macOS, I realised my PCIe capture cards will not function. This is kind of because, unless I have the money to blast on a Mac Pro, I won't have PCIe support. This knocks internal capture cards off my checklist for a while. That being said, there's another option: external capture cards. So with that, I bought the GC553G2, known as the AVerMedia Live Gamer ULTRA 2.1. This capture card allows 4K60 SDR capture, and HDR capture up to 4K30. It's not the same as my superior AVerMedia Live Gamer 4K, but the expectation is different for a USB-C capture card.
This is the fourth capture card I purchased, and the second one from AVerMedia. Let's put it through the tests and see what it is capable of. My end goal is to record gameplay from a PS3 and upload a new game series to YouTube. So we will need recording scripts. The usual procedure.
Checklist
As usual, I have a checklist of things I want from this capture card:
- It needs to work - Simple one. But Elgato's 4K60 S+ was discontinued for a reason...
- Recording lossless gameplay - The port is USB 3.2 Gen 2, which goes up to 10 Gbps. When recording with FFmpeg, I will pass this stream through into an MKV container losslessly, along with PCM audio.
- Corruption-resistance - When recording to MKV, there is corruption-resistance. So if my machine crashes, my recording is fine, for the most part.
- Surround Sound - This one might be a stretch, but I want surround sound on macOS. One of the selling points of this capture card is that, like the Live Gamer 4K, it can pass-through and record surround sound. But it states that it is Windows only.
-
Terminal only - When I do video editing and content creation, it
is all in the terminal. This means bypassing OBS and RECentral (if that
is even on macOS?) entirely and using FFmpeg and
avfoundation
. I want a script that will record gameplay and spit out a MKV file. -
Properly timestamped - All
DERPG uploads are in MKV
past 2017. All videos have a
DATE_RECORDED
timestamp since 2014 which provides the exact time recorded down to nanosecond accuracy.
I put my capture cards up to a high standard. And I want to see them succeed. So let's see how many of these bullet points I can meet.
Available Capture Options
I know this is a macOS post. But unfortunately AVFoundation doesn't have a
-list_options true
thing via FFmpeg. So we are going to slot
this card into a Windows machine and see what audio channel support we can
get out of the card stock. Surprisingly, the card's audio stack operates
differently depending on which OS it's running.
Windows
Ok let's see. On Windows, running FFmpeg to list the audio diagnostics of the card reveals the following available formats:
UNIX> ffmpeg -hide_banner -f dshow -list_options true -i audio="HDMI/Line In (Live Gamer Ultra 2.1-Audio)"
[dshow @ 000001ee1b3a2dc0] DirectShow audio only device options (from audio devices)
[dshow @ 000001ee1b3a2dc0] Pin "Capture" (alternative pin name "Capture")
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 44100
Last message repeated 1 times
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 44100
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 32000
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 32000
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 22050
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 22050
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 11025
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 11025
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 8000
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 8000
[dshow @ 000001ee1b3a2dc0] ch= 2, bits= 8, rate= 44100
[dshow @ 000001ee1b3a2dc0] ch= 1, bits= 8, rate= 44100
[dshow @ 000001ee1b3a2dc0] ch= 2, bits= 8, rate= 22050
[dshow @ 000001ee1b3a2dc0] ch= 1, bits= 8, rate= 22050
[dshow @ 000001ee1b3a2dc0] ch= 2, bits= 8, rate= 11025
[dshow @ 000001ee1b3a2dc0] ch= 1, bits= 8, rate= 11025
[dshow @ 000001ee1b3a2dc0] ch= 2, bits= 8, rate= 8000
[dshow @ 000001ee1b3a2dc0] ch= 1, bits= 8, rate= 8000
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 48000
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 48000
[dshow @ 000001ee1b3a2dc0] ch= 2, bits=16, rate= 96000
[dshow @ 000001ee1b3a2dc0] ch= 1, bits=16, rate= 96000
This is unfortunate. I'm guessing the way to access the 5.1ch support is to use RECentral. If you recall, in "The GC573 can record 7.1 Surround Sound (via FFmpeg)", the output gave an 8 channel output when the source was actually outputting a multi-channel signal. It should be noted that DirectShow may be limiting the card, rather than the card's support itself.
Notably though, 96kHz 16-bit is pretty nice. I wasn't expecting that. I believe the 4K60 S+'s onboard sound chip also supported 96kHz but I do not have one with me anymore to test that.
macOS
Interestingly, when we load up the capture card on macOS, the sound device reveals that it is actually a 4.0 channel device. This was after a firmware update to the latest version. Don't be mistaken though, this is not Quadraphonic Audio. When the headset jack isn't connected, all 4 channels are HDMI audio. Channels 3 and 4 copy channels 1 and 2 with slight delay and some crackling. When the headset jack is connected though, channels 1 and 2 include HDMI audio as well as audio coming through the jack. Channels 3 and 4 have HDMI audio only. In either case, channels 3 and 4 still have crackling audio issues.
[avfoundation @ 0x15b80c000] Selected pixel format (yuv420p) is not supported by the input device.
[avfoundation @ 0x15b80c000] Supported pixel formats:
[avfoundation @ 0x15b80c000] uyvy422
[avfoundation @ 0x15b80c000] yuyv422
[avfoundation @ 0x15b80c000] nv12
[avfoundation @ 0x15b80c000] 0rgb
[avfoundation @ 0x15b80c000] bgr0
[avfoundation @ 0x15b80c000] Overriding selected pixel format to use uyvy422 instead.
[avfoundation @ 0x15b80c000] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '0:5':
Duration: N/A, start: 27847.956900, bitrate: N/A
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 3840x2160, 1000k tbr, 1000k tbn, 1000k tbc
Stream #0:1: Audio: pcm_f32le, 48000 Hz, 4.0, flt, 6144 kb/s
It seems to default to 3840x2160 resolution. Specifying resolution in the AVFoundation parameters seems to fix this. It also assumes an unspecified FPS, typically around 100k-1000k. This value is fixed after the file is written. To give a concrete example on specifying resolution and framerate:
# Get the video and audio devices to specify for AVFoundation
DEV_VID="$(\
ffmpeg -f avfoundation -list_devices true -i "" 2>&1 \
| grep "Live Gamer Ultra 2.1-Video" \
| head -n 1 \
| sed 's/\[.*\] \[//;s/\].*//'
)"
DEV_AID="$(\
ffmpeg -f avfoundation -list_devices true -i "" 2>&1 \
| grep "Live Gamer Ultra 2.1-Audio" \
| head -n 1 \
| sed 's/\[.*\] \[//;s/\].*//'
)"
# Record
ffmpeg \
-hide_banner \
-f avfoundation -framerate 60 -video_size 1920x1080 -i "${DEV_VID}:${DEV_AID}"
This specifies 1920x1080 (1080p) at 60 FPS. I added in the additional
DEV_VID
and DEV_AID
so you can select devices in
an automated matter too. The FFmpeg command generates no video output. But
it's something we can build off of. Let's use it as a base.
Recording with FFmpeg
Codec Selection
Now for the good part. Let's actually record some gameplay with FFmpeg. For
starters, we need to specify a video and audio codec. Since I want a
lossless capture, there are three options: utvideo
,
huffyuv
, and magicyuv
. Given I used to record MW2
videos in Ut Video back in the early DERPG days, let's give that a shot.
You really can't go wrong with any of these formats. Of course, there is
also rawvideo
, but MKV doesn't like that, surprisingly.
For audio, since we know from Windows diagnostics that the card only
supports 16-bit signal, it's an easy choice, either flac
or
pcm_s16le
. I want to ease as much off of the CPU as possible.
So let's pick the latter. We can always compress to FLAC later on.
FFmpeg 4.2.2 is required
I should also note, the version of FFmpeg you use matters heavily here. If you use the latest version of FFmpeg, you will have audio lag and crackling issues because its AVFoundation implementation is broken. The latest version which doesn't have this issue is FFmpeg 4.2.2. I used Spack to compile FFmpeg 4.2.2 native for Apple Silicon and am testing this on an M1 Max and base M4.
For other capture cards, I capture losslessly via libx264rgb
.
But FFmpeg 4.2.2 doesn't have this codec as an option. So we must resort to
older, but tried-and-true, codecs like listed up above. This is ok. Because
it doesn't matter if we are capturing it losslessly anyway. We aren't
losing any data.
Recording with FFmpeg
Using the above script as a foundation, it's possible to record via:
# Timestamp of recording
DATE_REC="$(gdate +%s.%N)"
# Record
ffmpeg \
-hide_banner \
-rtbufsize 2G \
-f avfoundation -framerate 60 -video_size 1920x1080 -i "${DEV_VID}:${DEV_AID}" \
-map 0 \
-c:v utvideo \
-c:a copy \
-metadata DATE_RECORDED="$(gdate -d "@${DATE_REC}" -In | sed 's/,/./')" \
"${DATE_REC}.mkv"
This grabs the timestamp with nanosecond-precise detail, embeds it in the video file, and also makes the output's filename the timestamp. This guarantees the command will always output a unique filename for a video. Furthermore, it checks all of our boxes from up above, except for Surround Sound. That wasn't so hard, was it?
Issues
While testing the card, I ran into numerous issues that I feel the need to address. They all pertain to audio. Depending on how you configure FFmpeg (or even OBS, in this case...), you will run into a different issue. But they all involve audio loss. To put it simply, audio signal drops periodically while recording. It isn't even noticable when replaying the video half the time. But when it's uploaded to YouTube, there will be numerous audio drops.
The way I found to bypass this, ironically, is to record the audio in Audacity while recording both audio and video in FFmpeg. This capture card doesn't support the video stream being accessed by multiple applications. But the audio stream does support being accessed by multiple applications. So I simply record with Audacity, align the audio, export, remux via FFmpeg, and we are good to go. I guess that unchecks the Terminal only portion, doesn't it?
So, why not OBS?
I've stated this in numerous blog posts by now. But OBS struggles with the high recording standards I set. I want lossless video and audio. On Windows, OBS will simply crash after recording for some time. On Mac, the video records but will stutter and have glitched frames all over the place. Curious what I'm talking about? View this video to see what I mean. It's a disaster.
We, at DERPG, record at lossless to ensure the maximum flexibility in post. I want YouTube to have at least a first-generation or second-generation copy of a video. In other words, I want to either upload the lossless copy or a version that was compressed once. Either way, this means recording in lossless. And OBS just can't do it in my experience. I've lost too many recordings and it's been a frustrating experience. If OBS is powered by FFmpeg, there is nothing wrong with using raw FFmpeg.
Test Footage
Of course I was going to show some test footage from this card. I have two to show. One is a short video. Another is a 29 minute test session. Both are of the Japanese version of Need for Speed: Carbon. That game notably does support 5.1 surround sound. But we weren't able to record in surround sound here sadly. So stereo is the best we're going to get. Anyway, here's the two videos:
Short video test
|
Long session test
|
Good card for a simple test like a 1080p gaming console from 2006. The long
session test was after quite a struggle tweaking the FFmpeg command to give
exactly what I wanted. No audio lagging, no audio cutouts, no dropped
frames, etc. This was after a failed 2.5 hour recording where audio
dropouts were happening because I accidentally had -async 1
in
the FFmpeg arguments list. Whoops.
Conclusion
One of the better cards I've gotten. Better than the Elgato 4K60 S+ for sure. So far in my testing, the card only has minor hiccups. I'm content with it. I hope to produce a video series for DERPG soon using it. The end goal is to produce a video series on both the USA and Japanese releases of Need for Speed: Carbon for the channel. Just like SpyHunter. However, unlike the latter, which used emulation, we will be using actual console hardware this time. Stay tuned for that!