====== Record with OBS Studio ====== The biggest challenge when recording from an Android TV Box (video streaming hardware) is to record video and surround sound in sync. I tried several ways of doing this and found one which allows me to do it in one recording without too expensive hardware. I have not found a video capture card on the market which allows to record a protected video stream or multi-channel surround sound.\\ \\ **Note**: This guide is not intended to teach you how to circumvent copy protection. Make sure the source or service you are recording from allows you to make a copy for your own use before you record. Creating multiple copies or selling copies is prohibited by law. \\ **Note**: Subtitles stretch to convert from PAL to NTSC or vice versa: 0.960 / 0.959 or 1.0416 ===== Settings ===== ==== Gear ==== * Media Player: [[android:nokia|Nokia Streaming Box 8010]] or [[android:miboxs|Xiaomi Mi Box S 4K]] or [[android:km9|Mecool KM9 Pro]] Android streaming and video player * BDP: [[hw:udp203|OPPO UDP-203]] 4K Ultra HD Bluray Disc Player (player with HDMI passthrough and analog surround 7.1 audio outputs) * UDP-203 Remote: Original [[https://oppodigital.com/blu-ray-udp-203/blu-ray-udp-203-Support.aspx|Remote Control]] or [[https://play.google.com/store/apps/details?id=one.woodbury.oppo_remote&hl=en|Unofficial Oppo UDP-20X Remote]] App on Android Phone * Video Capture: [[https://www.blackmagicdesign.com/products/intensitypro4k/techspecs/W-INT-05|Blackmagic]] //Intensity Pro// 4K PCI-e capture card * USB Audio: [[https://www.esi-audio.de/|ESI]] //U86XT// USB audio interface * Isolator: [[https://www.amazon.com/dp/B082GV15Y1?psc=1&ref=ppx_yo2ov_dt_b_product_details|Conext Link AD104 RCA Stereo 2 Channel Ground Loop Isolator Signal Noise Filter Suppressor]] (avoid ground loop) * NoHDCP: [[https://www.ugreen.co.th/product/22/ugreen-40281-hdmi-audio-extractor-hdmi-to-hdmi-with-optical-toslink-spdif-audio|UGREEN 40281 HDMI Audio Extractor]] (disable HDCP) With this setup you can record video and 5.1 or 7.1 audio at the same time. ==== Cost of gear ==== * Media Player: 100 USD * Disc Player: 1000 USD (you need to find a premium player or another device with HDMI passthrough and analog surround audio outputs). Instead of a Disc Player you can utilitze any 5.1 pre-amplifier which supports an audio codec currently used by //Netflix//, //Disney+//, //Amazon Prime//, //HBO Go//, etc. If you use a pre-amplifier with variable output volume make sure you adjust the volume so you don't need to post-process amplification to it. Note that not every 5.1 pre-amplifier works, only one which supports the audio codec in the source stream. * Multi-channel USB audio interface: 300 USD (with 6 or 8 analog inputs). If you don't have one or do not want to buy one you can record the 6 channels in 3 stereo pairs and then sync the audio with Audacity. 3 stereo pairs means you need to record the stream 3 times, each time you connect a different pair of analog output to the analog stereo input of the Video Capture card (e.g. L/R, C/LFE, SL/SR). * Ground Loop Isolators: 30 USD (for 6 channels) * HDMI to HDMI converter: 30 USD (to remove HDCP) * TOTAL: **1500 USD** ==== Connection diagram ==== flowchart LR; Isolator["Ground Isolator"]; Capture["Video Capture"]; USBaudio["USB Audio"]; Box["Media Player"]; Box--HDMI-->NoHDCP; NoHDCP--HDMI-->BDP["Disc Player"]; BDP--"FL/FR C/SW SL/SR (6ch RCA)"-->Isolator; BDP--HDMI-->Capture; Capture--"PCI-e or USB"-->PC; Isolator--"FL/FR C/SW SL/SR (6ch RCA)"-->USBaudio; USBaudio--USB-->PC; click PC "#software" __Notes__: * The UDP needs to be set to //Source Direct// to pass through the video to the capture card, and the input needs to be set to //HDMI In//. * While //Netflix// has a desktop client from which you could separately record 5.1 audio, other streaming clients on Windows do not have this feature. ==== Steps ==== - Switch on Media Player - Switch on Disc Player - Set Disc Player to HDMI in with remote or handheld app - Start OBS ==== Software ==== * //[[https://obsproject.com/|OBS Studio]]// 27.2.4 * //[[https://handbrake.fr/downloads.php|HandBrake]]// 1.5.1 (GUI and CLI version) * //[[https://www.smplayer.info/en/downloads|SMPlayer]]// 22.2.0.10060 ==== Desktop Audio 5.1 ==== * Video: none * Audio: Windows 10 App ==== FHD Surround 5.1 (Intensity Pro) ==== * Video: Mi Box S -> 40281 (HDMI) -> Intensity Pro (HDMI) * Audio: Mi Box S -> 40281 (SPDIF) -> AVR-4308 (5.1 through Pre Out) to U86XT (Line IN 1-6) * Make sure you connect the U86XT through a Ground Loop Isolator to the AVR to avoid ground loop issues while recording * Set the AVR-4308 to volume -10 dB ==== VHS Stereo (Intensity Pro) ==== * Video: HR-S6711EU (composite) -> Intensity Pro (Y - green) * Audio: HR-S6711EU (stereo) -> Intensity Pro (RCA) * Audio monitor: HR-S6711EU (stereo) -> AVR-4308 ==== OBS Studio ==== === Settings === * Output\\ **Hint**: Chose //Simple// or //Advanced//, not both, then save. //Simple// is good for lossless recording of both video and audio. //Advanced// is only necessary for some special use cases. * Output Mode: Simple * Recording Path * Recording Quality: Lossless Quality * Output Mode: Advanced * Type: Custom Output (FFmpeg) * File path or URL * Container Format: matroska * Audio Bitrate: 256 Kbps * Audio Track: 1 * Audio Encoder: pcm_s16le * Audio * Sample Rate: 48 kHz * Channels: 5.1 or Stereo * Video * Base (Canvas) Resolution: 1920x1080 * Output (Scaled) Resolution: 1920x1080 * Downscale Filter: [no downscaling required] * Common FPS Values: 60 === Properties Intensity Pro 4K === * Video Connection: HDMI * Audio Connection: Analog RCA (we do not record the audio stream) === Properties ESI U86 XT === * Device: U86 Multichannel 8 (ESI Audio Device (WDM) - U86) * Advanced Audio Properties - Sync Offset: -120ms * Advanced Audio Properties - Tracks: 1 === Filters === * Limiter: Threshold -1.00 dB, Release 60 ms === Deinterlacing === * Disable ===== HandBrakeCLI ===== ===== Player Apps ===== In general, I recommend to set the Android TV Box to //Do not auto-update// apps in Google Play Store. I will explain below in the app sections. ==== Max ==== - The Max app does not run smoothly on Xiaomi Mi Box S, but does so on Mecool KM9 Pro - Install app version 5.11.0. This app version remembers your choice of displaying the full end credits without popping up choices of other movies, app version 5.12.0 (and probably later versions) do not remember your choice. I assume this was a bug in version 5.11.0 and I did not check whether older versions show the same behavior. - How to handle the end credits: - When the end credits start the app will display a choice of other movies - Press OK on the remote to bring back the end credits screen - Press LEFT to go back to a marker position in the movie before the display of choice of other movies shows up, then BACK to remove the status bar at the bottom - This time the end credits show through without display of choice of other movies - Use [[#handbrakecli|HandBrakeCLI]] to cut 2 parts of the movie including audio ===== How Tos ===== * [[https://www.google.com/search?q=control+clipping+in+obs+studio&rlz=1C1CHBF_enTH845TH845&oq=control+clipping+in+obs+studio&aqs=chrome..69i57j33i22i29i30l9.4656j0j1&sourceid=chrome&ie=UTF-8|Prevent Clipping]] * [[https://obsproject.com/wiki/Profiles-And-Scene-Collections#:~:text=A%20Profile%20saves%20most%20OBS,Profile%20for%20streaming%20on%20Twitch.|Profiles and Scene Collections]] * [[https://www.youtube.com/watch?v=Od5yZG1JmgE|How to transfer your VHS to Computer]] * [[https://obsproject.com/forum/threads/how-to-record-high-quality-wav-audio-in-obs.108095/|How to record high quality Wav audio in OBS ?]] * [[https://obsproject.com/forum/threads/correct-settings-for-capturing-vhs-please-help-a-newbie.131241/#:~:text=In%20OBS%2C%20set%20Settings%2D%3E,%22%20or%20%22Indistinguishable%20Quality%22.|Correct settings for capturing VHS]] * [[https://www.videoproc.com/video-editor/deinterlace-video.htm|5 Best Ways to Deinterlace Video in 2022]] * [[https://www.youtube.com/watch?v=UkKaVyx1ukU|How To Properly De interlace Videos To 50 or 60 Fps Progressive]]