USB HDMI Capture

With the latest DVR pre-release, you can more easily hook up a USB camera or HDMI capture dongle to your DVR.

As compared to the LinkPI and other encoder boxes, these dongles don't usually offer transcoding. But because the DVR knows how to use hardware transcoding for remote streaming, it can do the same thing with the capture feed (as long as your DVR hardware supports it).

  • macOS

    • capture://avfoundation/<video>/<audio>/?framerate=<30|60>
  • Windows

    • capture://dshow/<video>/<audio>/?framerate=60
  • Linux

    • capture://v4l2/<videoX>

For example, on my Mac I can record the built-in camera or using usb-c dongle:

#EXTM3U

#EXTINF:-1, channel-id="camera",Mac Camera Capture
capture://avfoundation/FaceTime HD Camera?framerate=30

#EXTINF:-1, channel-id="usb-hdmi",USB HDMI Capture
capture://avfoundation/USB Video/USB Digital Audio/?framerate=60

https://www.amazon.com/dp/B08Z3XDYQ7

(based on previous research in HDMI for Channels - #672 by tmm1)

7 Likes

To use this with AH4C or ADBTuner, you can use a dual source strategy:

  1. Capture source
  • create custom Text source with configuration for your capture device
  • set the source to disabled
  • copy the channel stream url and use it instead of a linkpi url
    • (for example, http://x.x.x.x:8089/devices/M3U-Capture/channels/9550/stream.mpg?format=ts&codec=copy)
  1. AH4C/ADBTuner source
  • use the M3U from AH4C/ADBTuner to create a second source which is enabled and used for recording/watching
1 Like

Will this work with a high powered AMD processor? The cpu doesn’t currently have hardware transcode but has plenty of power for software transcode. Is this project compatible with software transcoding?

So... is this just for AH4C and ADBTuner?

Can't just plug in a USB HDMI capture card, add that line as a M3U tuner source in the Server admin and away u go?

1 Like

Wow - this has potential to be VERY interesting - would think this maybe allows for better transcoding than the capture devices, including maybe > 2 channel audio.

MacOS 15.3.1

So MacOS considers these devices to be cameras and applies strict Privacy & Security restrictions to them.

I did some research this morning and as far as I can tell it is just not possible to access a camera from a process that is running as a LaunchAgent. It seems this was an intentional decision made by Apple and to be fair it makes sense.

With a standard installation of Channels DVR, ffmpeg will just hang as it never receives any video input.

For testing purposes I was able to work around this by running Channels DVR manually.

launchctl unload ~/Library/LaunchAgents/com.getchannels.dvr.plist
cd ~/Library/Application\ Support/ChannelsDVR/data
../latest/channels-dvr

and the following to run Channels normally when you are finished

launchctl load ~/Library/LaunchAgents/com.getchannels.dvr.plist

@tmm1 have you found a good workaround for this?


Audio Clicks and Crackle / ffmpeg with AVFoundation (MacOS only)

Edit: This turned out to be related to this ffmpeg issue:

https://trac.ffmpeg.org/ticket/11398

The Channels team have since applied the patch for this bug to their build of ffmpeg so it's no longer a concern for Channels users.

Works for me.

Works for me

Wow, this is exciting. What I am understanding from this is that I can use a Firstick 4K with an HDMI USB capture dongle on Windows and setup ADBTuner in a docket in my Windows to get a single channel input? That would be awesome!

Does it have to be a specific HDMI capture card?
All i have is this:
J5 Capture

I can not get this to work. I can get video input via the Camera app in Win 11 Pro on the server machine, so the OS recognizes the capture card fine and can use it.

But when i try to play it in Channels, i get, "Streaming to the tuner failed. Press Play to try again. Timeout after 32s."

2025/02/23 12:05:09.315385 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 12:05:09.343454 [HLS] ffmpeg: capture-usb-hdmi:  Unknown input format: 'dshow'
2025/02/23 12:05:09.345016 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: exit status 1
2025/02/23 12:05:09.345016 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 12:05:09.345537 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1 USB HDMI Capture: buf=0% drop=0%

Changed to MPEG-TS, same error.

Have you tried Stream Format MPEG-TS

Yes. Exact same error

1 Like

You have to put the names of your devices, like:

capture://dshow/Camera/Microphone/

Use:

c:\programdata\channelsdvr\latest\bin\ffmpeg.exe -list_devices true -f dshow -i dummy to see a list of them.


EDIT: Looks like we need to add dshow support

3 Likes

Using a Cheap HDMI USB Capture Card with FFmpeg on Windows 10 - RickMakes

here is a sample of what I was using when capturing with usb card.

ffmpeg -v panic -re -f dshow -rtbufsize 40M -video_size 1280x720 -framerate 30  -i video="USB3. 0 capture":audio="Digital Audio Interface (USB3. 0 capture)"  -vcodec h264_qsv -b:v 4000k -acodec aac -f mpegts -
1 Like

I get in CMD "The system cannot find the path specified."

EDIT:

Had to modify path,. there is no bin folder
C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -list_devices true -f dshow -i dummy

That output gives me:

[dshow @ 000001c860b436c0] "J5-CAPTURE" (video)
[dshow @ 000001c860b436c0]   Alternative name "@device_pnp_\\?\usb#vid_0711&pid_0a04&mi_00#6&38a547e9&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 000001c860b436c0] "Digital Audio Interface (J5-AUDIO)" (audio)
[dshow @ 000001c860b436c0]   Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{BA1A252E-EDEC-4321-9AB5-7528DA21FA48}"
dummy: Immediate exit requested

ok so i changed it to:

#EXTM3U
#EXTINF:-1, channel-id="usb-hdmi",USB HDMI Capture
capture://dshow/J5-CAPTURE/J5-AUDIO/?framerate=60

2025/02/23 15:51:18.608464 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 15:51:18.651871 [HLS] ffmpeg: capture-usb-hdmi: [dshow @ 000002656669ec80] Could not find video device with name ["J5-CAPTURE",audio="J5-AUDIO"] among source devices of type video.
2025/02/23 15:51:18.652376 [HLS] ffmpeg: capture-usb-hdmi: video="J5-CAPTURE",audio="J5-AUDIO": I/O error
2025/02/23 15:51:18.655077 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: exit status 1
2025/02/23 15:51:18.655077 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture

Same issues for a Logitech webcam

2025/02/23 16:01:18.548574 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 16:01:18.584894 [HLS] ffmpeg: capture-usb-hdmi:  [dshow @ 00000249c35ae240] Could not find video device with name ["HD Pro Webcam C920",audio="Microphone (HD Pro Webcam C920)"] among source devices of type video.
2025/02/23 16:01:18.585398 [HLS] ffmpeg: capture-usb-hdmi:  video="HD Pro Webcam C920",audio="Microphone (HD Pro Webcam C920)": I/O error
2025/02/23 16:01:18.588477 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: exit status 1
2025/02/23 16:01:18.588477 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
#EXTM3U
#EXTINF:-1, channel-id="usb-hdmi",USB HDMI Capture
capture://dshow/HD Pro Webcam C920/Microphone (HD Pro Webcam C920)/?framerate=60
C:\Windows\System32>C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -list_devices true -f dshow -i dummy
[dshow @ 0000027f005ed880] "HD Pro Webcam C920" (video)
[dshow @ 0000027f005ed880]   Alternative name "@device_pnp_\\?\usb#vid_046d&pid_082d&mi_00#6&1182fde4&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
[dshow @ 0000027f005ed880] "Microphone (HD Pro Webcam C920)" (audio)
[dshow @ 0000027f005ed880]   Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\wave_{CD2E62BD-B324-4812-8B32-CC984BE40362}"
dummy: Immediate exit requested

Also, is there a way to not trigger a full system guide data refresh every time i change/save this m3u custom tuner? My guide data now is saying timeout and just hanging cause it has tried about a dozen times in the last few minutes.

Try with DVR Pre-Release Notes - #1669 by fancybot

Same error.

2025/02/23 17:22:23.124583 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 17:22:23.159919 [HLS] ffmpeg: capture-usb-hdmi:  [dshow @ 000002658cc0e240] Could not find video device with name ["HD Pro Webcam C920"] among source devices of type video.
2025/02/23 17:22:23.160942 [HLS] ffmpeg: capture-usb-hdmi:  video="HD Pro Webcam C920":audio="Microphone (HD Pro Webcam C920)": I/O error
2025/02/23 17:22:23.164803 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: exit status 1
2025/02/23 17:22:23.164803 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/23 17:22:23.164803 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1 USB HDMI Capture: buf=0% drop=0%
1 Like

I second this request.

1 Like

Another one: DVR Pre-Release Notes - #1670 by fancybot

1 Like