cybrkyd

Recording streams with FFmpeg

 Mon, 04 May 2026 08:42 UTC

I’m a fossil when it comes to FFmpeg. I have previously explored encoding using the onboard integrated AMD or Intel chips, but have always had sub-par results when comparing that result to the one output by libx264 or libx265. That means I have always stuck to the high-CPU software encoding method.

Recording from the Sky Stream puck with on-the-fly software encoding was a no-go on my laptop. The AMD Ryzen 5 CPU hits 75% immediately, and continues climbing. It takes literally less than two minutes before the fans kick in to cope with all that heat.

So VAAPI was the only way forward.

I tested at least 10-12 different FFmpeg commands, tweaking as I went and I have finally settled on this one:

ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -use_wallclock_as_timestamps 1 -fflags +genpts -f v4l2 -thread_queue_size 512 -input_format mjpeg -video_size 1920x1080 -i /dev/v4l/by-id/usb-Actions_Micro_UGREEN-25854_-1575465188-video-index0 -f pulse -thread_queue_size 512 -i default -vf "format=nv12,hwupload" -c:v hevc_vaapi -rc_mode VBR -b:v 5M -maxrate 5M -bufsize 8M -g 60 -bf 0 -c:a aac -b:a 128k output.mp4

I had initially enforced framerate but this proved to be troublesome, sometimes resulting in very jerky scenes. I’ve noticed that the Sky Stream puck can output at 60fps, 50fps or 30fps, and this varies from channel to channel and from app to app. For example, HBO pushes 30fps as does Apple TV, and Sky itself varies between 50fps and 30fps when watching a non-linear stream. Because of these differences, I tried discarding the enforced framerate and my results improved immediately.

In general, random “choppiness” or scene jerkiness was the main issue I faced. Without the framerate enforced, the situation improved but was still occurring. I have solidly put this down to a combination of hardware encoding (using the CPU) and the fact that the streams are, well, streams. They are not “clean” inputs in the way that, say, DVD or Blu-ray are. I’ve deduced that from the fact that when I encode with libx264 / libx265, I have not once experienced a scene jerk, ever.

Anyhow, with the above command, I have managed to severely limit the occurrence of those annoying jumps.

Recording

I recorded the entire series of The Miniature Wife. You know, for educational purposes. This was recorded from the Sky Store, so not the live broadcast ones. The show started off well enough but Elizabeth Banks’s character was too screamy, whiney and sweary for my liking…no wonder she was shrunk.

As I went through the recordings, that was where I learned which tweaks worked and which didn’t. By the time I got closer to episode #10, I was cooking with gas. The choppiness was right down – the last few episodes were barely noticeable and I swear I’ve watched a couple of them with no jumps at all.

Interestingly, I was watching something else which I downloaded. It was marked as “AMZN.WEB-DL” or “WEBRip” and what do you know? It had a couple of scene jumps! I just never noticed these before. It is nice to know that this issue is not unique to me.

All that aside, I’m happy with the results I am now getting with this FFmpeg monstrosity. It is one huge command but it does the job. The recordings are not meant to be Hollywood quality or intended for torrent distribution; they are for my own personal consumption, so this works fabulously for my humble needs.

The good thing with this way is that it is repeatable with regards to the stable USB connection to the laptop as well as the resulting output quality. I’ve recorded quite a few other episodes of other shows as well as a couple of movies and I’m now in that “consistent results” phase where I can start recording without worrying about what it will spit out the other side.

Sky Stream versus Formuler

I’ve noticed that the results are even cleaner with regards to “choppiness” when recording from my Formuler box. The frame rate is constant at 30fps, no matter what app I’m recording from – HBO, Apple TV, Prime, Discovery+ and Disney+. The scene jumps are almost non-existent in all my tests, and so I have moved my splitter from the Sky Stream box to the Formuler, and there is shall remain. There is not much that I would want to record from linear or live broadcasts anyway.

The only app I cannot get on my Formuler is Netflix, but I’m not going to stick with the Sky Stream puck for the sake of Netflix. I’m not really a fan and besides, that’s what torrents are for.

Cleaning ads

Avidemux is still the king. I remove the ads, making sure I’m on a key frame, and then save the edit without re-encoding. It’s quick and suitable for the rough cutting of my recordings. Because Avidemux is not capable of scene cuts, a few frames of the ads do tend to creep in once in a while, but this is not too much of a bother for me. It is a big improvement on fast-forwarding the VHS cassette, hoping to catch it before the program resumes!

Yeah, I’m a fossil! :-)

Now, wouldn’t it be cool if there was a way to have a tiny PVR club with friends and some strangers where we could all share our roughly-edited recordings?

»
Tagged in:

Visitors: Loading...