Table of Contents

Video Capture

I am using Kodi to make all my DVDs and Bluray Discs available on demand on all screens I have in my house. I legally purchased and I am owning all titles on original disc (no pirated copies!) or through a subscription. I wrote this guide for myself, as the steps to create a working file to be used by Kodi can be quite elaborate. If you want to follow this guide please be reminded that copyright infringement (piracy) is punishable by law, and that you need to make sure you do not violate copyright laws in your country. Copying titles from streaming services might be illegal, or you might be required to delete such copies after termination of the subscription.

Hardware

I'm using the following hardware for capturing movies and will refer to the names in bold italic within my walk-throughs:

I use the excellent Blackmagic Design Intensity Pro 4K as capture card. Linux, Windows, and Mac are supported by Blackmagic Design. However, like every other current capture card on the market it does not allow to capture compressed surround sound. The Intensity Pro 4K has excellent image quality, and allows to capture audio in digital or analog stereo. The cards primary usage scenario is not capturing game play, but capturing HDMI video for video mastering purposes. The Hauppauge Colossus 2 capture card reportedly is capable of capturing compressed surround audio, but the video section is much weaker compared to the Intensity Pro 4K (1080p limited to 30fps, for example) and I did not bother to try it. I haven't found any current technology card at a reasonable price which can do this.

Software

All software required and listed below are available on Windows 10, Mac, and Linux.

Media Express delivers better quality capture compared to OBS Studio when capturing from HDMI. However, the streams are not compressed, and the generated files are huge, 2 hours capture results in a 1 TB large file if encoded in 10 bit quality. You will need very fast disc access achievable with a SSD, use Blackmagic Disc Speed Test to verify your system is fast enough for the capture. OBS Studio is more tolerant if you compress the file before writing to disc, but stresses the CPU more than Media Express.

Capture from Bluray Disc

Good to know

I normally use MakeMKV (Rip DVD and BD to mkv video file) on Hercules to create mkv files from DVD and BD discs. There seem to exist a few BD discs which are protected with some sort of hardware protection MakeMKV refuses to read or copy. Those titles need to be captured from the BD disc player, here are the necessary steps for a best possible capture quality. This work flow is based on using UDP, AVR, BDMI, and UGREEN.

Work flow

  1. Decide first, how you want to capture the audio. For stereo, set UDP's speaker configuration to stereo, for 5.1 set it to 5.1 downmix. This will make sure that the correct audio channels are served through UDP's analog audio outputs. I normally capture my main audio track with 5.1, and other audio tracks with stereo. For me, the main audio track is English, but I also capture German and Thai if available.
  2. Connect HDMI from AVR HDMI out –> UGREEN –> BMDI HDMI in. As my AVR has 2 HDMI out ports this allows to watch the video during capture, but it is also possible to connect from HDMI out of the BD disc player (UDP). Remark: do not switch off the TV after capturing has started, as this will result in lost frames in the recording.
  3. Connect analog audio from UDP FL/FR –> BMDI Analog Stereo in. You have several options for this (be reminded that the frame rate is taken from the input source):
    • Media Express: Capture video and audio as AVI or Quicktime 10-bit YUV. You need a lot of super-fast disc space, 2 hours 1920×1080 @ 24 fps requires 1TB, 2 hours 1920×1080 @ 60 fps requires 2.5TB disc space! It's the best quality option at very high cost of disc space.
    • OBS Studio: Capture video and audio as AVI lossless 8-bit YUV (Lossless Quality setting). You need a lot of fast disc space, 2 hours 1920×1080 @ 24 fps requires 370GB, 2 hours 1920×1080 @ 60 fps requires 1TB disc space! It's a good quality option at high cost of disc space.
    • OBS Studio: Capture video and audio with indistinguishable or high quality setting. The video stream will be compressed, but you need much less disc space, and it's also your only choice if you do not have a large SSD available.
  4. Connect analog audio from UDP SL/SR –> BMDI Analog Stereo in. Capture video and audio. The format does not matter as we will discard the video stream of this recording.
  5. Connect analog audio from UDP C/LFE –> BMDI Analog Stereo in. Capture video and audio. If you prefer to create stereo audio you can skip the last 2 captures.
  6. Encode the first capture with your preferred video encoder settings in Handbrake. I'm using HEVC (H265) 10 bit 1920×1080, quality setting 22. The BD disc most likely was encoded with 24 or 25fps, you can keep this.
  7. Audio streams in Media Express are raw 24-bit @ 48kHz, in OBS Studio they are raw 16-bit @ 48kHz.
  8. If you require 2 channel stereo audio you can encode it along with the video in Handbrake.
  9. If you require 5.1 channel surround audio you need to create the 5.1 AC3 file first:
    • import the 3 audio streams of the 3 captured video files in the correct sequence, FL/FR, then C/LFE, then SL/SR. Split all stereo tracks into mono tracks and rename them for easier identification.
    • audio streams from Media Express might be too large to handle for Audacity, in which case you encode them with Handbrake using a simple video encoder (which makes it faster, as we only need the audio stream) setting the audio to FLAC 24 bit for lossless audio encoding
    • amplify the streams to get the correct volume. If you used your AVR's pre-outs to obtain the surround audio tracks you need to amplify the signal (all tracks with the same value). Once you have determined how much the amplification should be write down the amplification value and the volume of the AVR you used when recording, so you can set the same values again for any later recordings.
    • time-shift the streams to sync all channels. For this you need to find some suitable positions in the audio. Find a “surround” location in the audio and sync FL/FR and SL/SR, then find a location with speech and sound to sync C. When finished, listen to several locations in the audio file to check the sound.
    • Export Audio…, save as type AC3, and set the Bit Rate to 640 kbps.
  10. Identify where the video should begin and end, then trim the video stream with one of the following 2 programs. avidemux allows to use a GUI, mkvmerge is part of MKVToolNix and requires usage of the command line.
    • SMPlayer. Open the video file and find beginning and end of the stream to keep.
    • avidemux. Open the video file and find beginning and end of the stream to keep, then cut & paste into the same file, which brings the required part to the front of the file. Now find again the end, and delete everything after that marker.
    • mkvmerge. Open the command line, change directory on the drive to where mkvmerge is located, for example C:. Change to the drive and directory where the video stream is located, for example E:\Handbrake, then issue the following command:
      c:mkvmerge --split parts:00:00:10-01:57:20 -o "output.mkv" "input.hevc"
  11. This would create a video stream file with the length of 1 hour 57 min 10 sec and which starts 10 sec after the original capture file. Note that mkvmerge cannot handle audio streams encoded with FLAC lossless. You might need to trial and error the stream end by a few seconds, as it appears that the length of the video file is not always accurately cut.
  12. Mux the video stream and the newly created AC3 audio stream into a mkv file with MKVToolNix. Set delay to offset the start of the video and the audio.
  13. You might want to create a chapter file to be loaded into the mkv file, too. Either create one with fixed chapter length, for example every 10 minutes, or search for chapter positions in the video file, which you can also do using the BD disc player and the original Bluray disc. Export a chapter file from an existing mkv file to get the format of the chapter file correct.
  14. Check your final result. DONE.

Stereo capture only

  1. To capture audio in stereo only set the UDP to stereo and capture audio through HDMI embedded with BMDI.
  2. For stereo capture from Mi Box, connect the Mi Box's audio out with BMDI RCA analog audio in.

In case not all streams are protected or broken

  1. It is possible that some streams within the file are readable, even if MakeMKV aborts with read errors.
  2. Check it and extract streams with HdBrStreamExtractor.
  3. In one of my BDs I could extract all audio and subtitle streams, but not the video stream. I then captured the video stream only with BMDI, extracted audio and subtitles from the disc, and muxed everything into one file with mkvtoolnix.
  4. Consider to transcode DTS-HD or other high definition formats with Handbrake to AC3 surround to save space.

Screen Capture

Good to know

Simple work flow

One pass capture without re-encoding of the video and a single audio track.

  1. For stereo, set your speaker configuration to stereo, for 5.1 set it to 5.1, irrespective of what kind of speakers you have connected to your system. In Windows 10 20H2 open Settings, then System –> Sound, and select Sound Control Panel to the right. Highlight Speakers and select Configure to set the audio channels. Remember to set this back to stereo after the capture if you have stereo speakers or headphones connected.
  2. Open the app, media player, or browser from which you want to capture. Browser capture will allow stereo audio only.
  3. Open OSB Studio, then setup Display Capture and select the monitor dedicated to display the video.
  4. Setup Audio Output Capture and select the Speakers you configured in the first step.
  5. In Settings –> Audio, set Channels to Stereo or 5.1.
  6. In Settings –> Output, set “Recording Quality” to “Same as stream” or “High Quality” and start capturing, wait until the mkv file is created.
  7. Identify where the video should begin and end, then trim the video stream with avidemux. Note that avidemux can correctly trim the video only at a key frame, which occurs approximately every 10 seconds. Refer to the advanced work flow if you need more accurate trimming.

Advanced work flow

Multi-pass capture with re-encoding of the video and multiple surround or stereo audio tracks. Requires a lot more time and extensive usage of the command line, but delivers best possible quality.

  1. For stereo, set your speaker configuration to stereo, for 5.1 set it to 5.1, irrespective of what kind of speakers you have connected to your system. In Windows 10 20H2 open Settings, then System –> Sound, and select Sound Control Panel to the right. Highlight Speakers and select Configure to set the audio channels. Remember to set this back to stereo after the capture if you have stereo speakers or headphones connected.
  2. Open the app, media player, or browser from which you want to capture.
  3. Open OSB Studio, then setup Display Capture and select the monitor dedicated to display the video.
  4. Setup Audio Output Capture and select the Speakers you configured in the first step.
  5. In Settings –> Audio, set Channels to Stereo or 5.1.
  6. In Settings –> Output, set “Recording Quality” to “Lossless Quality” and start capturing, wait until the avi file is created.
  7. If capturing multiple languages, set the next language in the app (or media player or browser) and disable “Display Capture” which will save a lot of disc space.
  8. Find beginning and end of the stream to keep
    • SMPlayer allows to play full video and step by frame with “.” or step back with “,”.
    • avidemux, but for some very large avi files avidemux cannot detect the end of file, so you might need to encode a second time with the correct duration of the video. Do not use avidemux to trim the file, just to identify where HandBrakeCLI should start and stop encoding.
  9. Encode with HandBrakeCLI which allows setting start and end markers of the encode, which will set new key frames. The easiest way is to define presets in HandBrake (GUI) which work for you, and then use that preset for the encode. You might need to override the frame rate, if your preset is used for discs and streams. To simplify the command I recommend to place a short batch file into the same directory where HandBrakeCLI.exe is located:
    @ECHO OFF
    IF "%4" == "" GOTO:usage
    HandBrakeCLI -i "H:\Blackmagic\%~1.avi" -o "E:\Handbrake\%~1.mkv" --preset-import-gui --preset "1080p H265" --rate %2 --cfr --start-at seconds:%3 --stop-at seconds:%4
    GOTO:eof
    :usage
    echo Usage: %0 "file name" ^<frame rate^> ^<start at sec.msec^> ^<duration in sec.msec^>

    Handbrake might not be able to read the audio tracks, in which case you will need to convert the format in Audacity first. If you convert a stereo track you can offset the track in Audacity with the same number of seconds.milliseconds as you offset the video.

  10. Create a new project in Audacity and import all audio files of all languages. Stereo audio tracks will be imported as 1 Stereo track, Surround 5.1 audio tracks will be imported as 6 Mono tracks, sequence FL, FR, C, LFE, SL, SR.
  11. Stereo:
    1. align (time-shift) the tracks by listening to speech which no or minimal sound, do this in several locations, preferrably at the beginning and at the end of the tracks.
  12. Surround:
    1. Move all C-tracks up so you get them next to each other, e.g. move language 2 C-track up until it is below language 1 C-track, then move language 3 C-track up until it is below language 2 C-track.
    2. align (time-shift) the tracks by listening to speech which no or minimal sound, do this in several locations, preferrably at the beginning and at the end of the tracks.
    3. move all C-tracks down to the original position
    4. time-shift all tracks of the same language to be aligned with the C-track
    5. find a common start and end location in the tracks and take a note of it, for example 00h00m10.000s - 01h43m22.380s
    6. Set the selection range at the bottom of Audacity to 00h00m00.000 - 00h00m10.000s in each track and cut the selection
    7. Set the selection range at the bottom of Audacity to 01h43m12.380 - 02h43m12.380s in each track and cut the selection (the location in the track is 10s earlier as we cut 10s in the previous step)
  13. Noise reduction:
    1. You might get some noise into your audio when capturing through analog output from the AVR or UDP. To reduce it, do one or all of the following.
    2. connect BMDI to AVR with a HDMI cable, which creates a ground connection between the 2 devices to eliminate a possible ground loop
    3. use a stereo cinch cable with a magnetic ring or add a magnetic ring to your cable to reduce signal noise
    4. use Audacity's Noise Reduction effect to reduce the noise. Follow the help screen's instructions, the default values have worked well for me
  14. Set Use Advanced Mixing Options in Edit –> Preferences –> Import / Export when exporting 6 mono channels into one 5.1 AC3 file
  15. Select the audio tracks of the same language and Export Selected Audio. For surround choose AC3 and 640 kbps, for stereo choose AC3 and 160 kbps. You might first need to install ffmpeg in Audacity to get access to the AC3 codec.
  16. Mux the video track and all audio tracks into a mkv file with MKVToolNix. You will need to sync the video with the audio, find some positions in the file with clear speech to do so.
  17. You might want to create a chapter file to be loaded into the mkv file, too. Either create one with fixed chapter length, for example every 10 minutes, or search for chapter positions in the video file. For the latter, export a chapter file from an existing mkv file to get the format of the chapter file correct.

Capture from a streaming service which streams to Windows 10 in Surround

  1. Connect HDMI from Mi Box or AVR HDMI out –> UGREEN –> BMDI HDMI in and capture. See also Capture from Bluray Disc).
  2. Do a Screen Capture of the same movie played in the Windows 10 app and record audio only.
  3. Extract the audio from the second capture and mux it with the video file of the first capture. Add a chapter file and downloaded subtitles.

Capture from a streaming service which does not stream to Windows 10 in Surround

  1. Connect HDMI from Mi Box or AVR HDMI out –> UGREEN –> BMDI HDMI in and follow the same steps as described in Capture from Bluray Disc.
  2. If you use your AVR's pre-outs you will need to connect the spdif out from Mi Box or UGREEN to the AVR.

Capture from a streaming service which streams to Windows 10 but not to a TV app

  1. Connect HDMI from PC HDMI out –> UGREEN –> BMDI HDMI in and follow the same steps as described in Capture from a streaming service which streams to Windows 10 in Surround.
  2. Helpful if the movie you want to record is not available in your region but can be streamed through login to a different regional marketplace.

Adjusting track length

Some special considerations are necessary if you combine tracks from different sources. For example, you want to capture an additional audio track for a movie you already own on disc. Such movies can have different length in minutes, even if the scene cut is identical. For example, the movie Six Days Seven Nights on DVD with English and Thai audio and subtitles (NTSC version) is 1h 41m 57s, where as the same movie with identical cut on a German DVD (PAL version) is 1h 37m 51s, so the NTSC version is 1.0427 times longer, and the PAL version is 0.959 times shorter. This is exactly the ratio between 25 fps (PAL, fps = frames per second) and 23.976216 fps (NTSC).

Capture Surround Sound from HDMI or spdif

FIXME I haven't figured out how to do that yet. Below are some links to information.