USB HDMI Capture

Next step is to create a custom channel as MPEG-TS / Text and see if you can get the stream showing up in Channels DVR

Windows capture isn't quite working yet, but I just pushed another pre-release based on @speedingcheetah's latest logs


1 Like

@tmm1 Upgraded, working now, but looks like crap. (forgot had to change the webcam framerate to 30 not 60 then it worked. Still getting some errors

2025/02/24 10:40:33.925518 [TNR] Opened connection to M3U-USBHDMICapture for ch2 USB Webcam
2025/02/24 10:40:34.987195 [HLS] ffmpeg: capture-usb-webcam:  Guessed Channel Layout for Input Stream #0.1 : stereo
2025/02/24 10:40:35.147391 [HLS] ffmpeg: capture-usb-webcam:  [h264_mf @ 0000017eabb50bc0] stream format change
2025/02/24 10:40:41.992177 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch2 USB Webcam: buf=0% drop=0%
2025/02/24 10:40:41.992767 [TNR] Closed connection to M3U-USBHDMICapture for ch2 USB Webcam
2025/02/24 10:40:41.992767 [ERR] Error during stream M3U-USBHDMICapture ch2 USB Webcam: read |0: file already closed
2025/02/24 10:40:41.992767 [HLS] ffmpeg: capture-usb-webcam:  av_interleaved_write_frame(): Invalid argument
2025/02/24 10:40:42.009556 [HLS] ffmpeg: capture-usb-webcam:  Error writing trailer of pipe:: Invalid argument
2025/02/24 10:40:42.010078 [HLS] ffmpeg: capture-usb-webcam:  Error closing file pipe:: Invalid argument

BUT, is now working for HDMI capture, but it looks like crap. Can't read any words, and is heavy pixelated.

2025/02/24 10:32:10.794289 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/24 10:32:11.298068 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 00000253c8980500] EOI missing, emulating
2025/02/24 10:32:11.743422 [HLS] ffmpeg: capture-usb-hdmi:  Guessed Channel Layout for Input Stream #0.1 : stereo
2025/02/24 10:32:11.752905 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 00000253cfbdafc0] overread 8
2025/02/24 10:32:11.752905 [HLS] ffmpeg: capture-usb-hdmi:      Last message repeated 1 times
2025/02/24 10:32:11.752905 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 00000253cfbdafc0] EOI missing, emulating
2025/02/24 10:32:11.756069 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfa2c940] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.756069 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb34a640] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.756590 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253c89ad6c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.756590 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb3abec0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.757111 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb3ca800] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.757787 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfc0eec0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.757787 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfc1be80] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758317 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfa795c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758317 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb407380] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758841 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb1380c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758841 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfb00040] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758841 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cfb0e480] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.758841 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 00000253cfa1f980] [swscaler @ 00000253cb153e40] deprecated pixel format used, make sure you did set range correctly
2025/02/24 10:32:11.959271 [HLS] ffmpeg: capture-usb-hdmi:  [h264_mf @ 00000253cb315a80] stream format change
2025/02/24 10:34:08.752595 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1 USB HDMI Capture: buf=0% drop=0%
2025/02/24 10:34:08.752595 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: read |0: file already closed
2025/02/24 10:34:08.752595 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/24 10:34:08.753148 [HLS] ffmpeg: capture-usb-hdmi:  av_interleaved_write_frame(): Invalid argument
2025/02/24 10:34:08.774007 [HLS] ffmpeg: capture-usb-hdmi:      Last message repeated 1 times
2025/02/24 10:34:08.774007 [HLS] ffmpeg: capture-usb-hdmi:  Error writing trailer of pipe:: Invalid argument
2025/02/24 10:34:08.774007 [HLS] ffmpeg: capture-usb-hdmi:  Error closing file pipe:: Invalid argument

I have the capture card hooked to my Dell laptop that is clone display mode 1080p 60hz. Looks the same if i change to Extended display. Picture is crystal clean and perfect in OBS or the Win 11 Camera app.

Just a note that i forgot to change the framerate of webcam in the m3u to 30. Now it works.
I edited my post to include the new log entries.

Things are working, but look so garbo that it is unusable.
Can confirm that the capture image, in native camera app or OBS form webcam/HDMI capture is nice and clean and perfect look, it just garbo in Channels.

Is there more work to be done, there are still some errors and things the logs indicate may be an issue.
Would be great if there was some GUI exposed options in the server, maybe, or other arguments to add to the m3u to improve the picture?

I am using a custom built PC, with a Intel 12th Gen i5-12400 cpu and its integrated graphics as my CDVR server.

Can you submit diagnostics while it is streaming.

1 Like

89f98a49-d0f8-4251-ae7f-97fb04bf2beb

I also did diags from the app after streaming, if that also helps.

Try DVR Pre-Release Notes - #1675 by fancybot

significantly better looking, but still, is not great. Text is still difficult to read, and has many artificing. Stats say is 720p stream. Anyway to get that to 1080?

User facing options to adjust these things also would be nice, for a future final implementation of these feature i would think.

Weird, wonder why it looks so bad.

You can add &video_size=1920x1080 if that's supported.

And the webcam is doing 640x480.

That helped alot!. Still getting alot of flickering and some odd artificing that is not present with other capture software that pulls from the capture device.

Still see some things in the logs like:

2025/02/24 12:13:11.661949 [TNR] Opened connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/24 12:13:12.109659 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 0000021cc17f0a80] Found EOI before any SOF, ignoring
2025/02/24 12:13:12.109659 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 0000021cc17f0a80] No JPEG data found in image
2025/02/24 12:13:12.569724 [HLS] ffmpeg: capture-usb-hdmi:  Guessed Channel Layout for Input Stream #0.1 : stereo
2025/02/24 12:13:12.571758 [HLS] ffmpeg: capture-usb-hdmi:  Error while decoding stream #0:0: Invalid data found when processing input
2025/02/24 12:13:12.572697 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 0000021cc8aae200] Found EOI before any SOF, ignoring
2025/02/24 12:13:12.572697 [HLS] ffmpeg: capture-usb-hdmi:  [mjpeg @ 0000021cc8aae200] No JPEG data found in image
2025/02/24 12:13:12.572697 [HLS] ffmpeg: capture-usb-hdmi:  Error while decoding stream #0:0: Invalid data found when processing input
2025/02/24 12:13:12.580808 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc46010c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.581810 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc8c135c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.582350 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc8c23080] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.582350 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc1857740] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.582350 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc4436440] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.582930 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc8b94a00] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.582930 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc8c63700] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.583444 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc8d9b740] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.583444 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc9ad2d40] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.583444 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc9b90040] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.583958 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc9bf7040] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.583958 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc9c04000] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.584470 [HLS] ffmpeg: capture-usb-hdmi:  [swscaler @ 0000021cc3410880] [swscaler @ 0000021cc9ca0040] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:12.776938 [HLS] ffmpeg: capture-usb-hdmi:  [h264_mf @ 0000021cc338fc00] stream format change
2025/02/24 12:13:12.925138 [HLS] ffmpeg: capture-usb-hdmi:  [dshow @ 0000021cc179eb40] real-time buffer [J5-CAPTURE] [video input] too full or near too full (69% of size: 3041280 [rtbufsize parameter])! frame dropped!
2025/02/24 12:13:27.087684 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1 USB HDMI Capture: buf=0% drop=0%
2025/02/24 12:13:27.088253 [ERR] Error during stream M3U-USBHDMICapture ch1 USB HDMI Capture: read |0: file already closed
2025/02/24 12:13:27.088253 [TNR] Closed connection to M3U-USBHDMICapture for ch1 USB HDMI Capture
2025/02/24 12:13:27.088867 [HLS] ffmpeg: capture-usb-hdmi:  av_interleaved_write_frame(): Invalid argument
2025/02/24 12:13:27.112881 [HLS] ffmpeg: capture-usb-hdmi:      Last message repeated 1 times
2025/02/24 12:13:27.112881 [HLS] ffmpeg: capture-usb-hdmi:  Error writing trailer of pipe:: Invalid argument
2025/02/24 12:13:27.112881 [HLS] ffmpeg: capture-usb-hdmi:  Error closing file pipe:: Invalid argument

and

2025/02/24 12:13:31.679701 [TNR] Opened connection to M3U-USBHDMICapture for ch2 USB Webcam
2025/02/24 12:13:33.058490 [HLS] ffmpeg: capture-usb-webcam:  Guessed Channel Layout for Input Stream #0.1 : stereo
2025/02/24 12:13:33.394541 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d2f4f200] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.394887 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d2f93ac0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.394887 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d2fdf080] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.394887 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d302ddc0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.395390 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d307b100] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.395390 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d39100c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.395906 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d391d080] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.395906 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d3994f40] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.395906 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d39b05c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.396421 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d3a349c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.396421 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d3a42ac0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.396937 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d3aad0c0] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.396937 [HLS] ffmpeg: capture-usb-webcam:  [swscaler @ 000001f3d2f39200] [swscaler @ 000001f3d3abde00] deprecated pixel format used, make sure you did set range correctly
2025/02/24 12:13:33.600889 [HLS] ffmpeg: capture-usb-webcam:  [h264_mf @ 000001f3ce9df040] stream format change
2025/02/24 12:13:43.863945 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch2 USB Webcam: buf=0% drop=0%
2025/02/24 12:13:43.863945 [ERR] Error during stream M3U-USBHDMICapture ch2 USB Webcam: read |0: file already closed
2025/02/24 12:13:43.863945 [TNR] Closed connection to M3U-USBHDMICapture for ch2 USB Webcam
2025/02/24 12:13:43.928773 [HLS] ffmpeg: capture-usb-webcam:  av_interleaved_write_frame(): Invalid argument
2025/02/24 12:13:43.941069 [HLS] ffmpeg: capture-usb-webcam:      Last message repeated 1 times
2025/02/24 12:13:43.941069 [HLS] ffmpeg: capture-usb-webcam:  Error writing trailer of pipe:: Invalid argument
2025/02/24 12:13:43.941069 [HLS] ffmpeg: capture-usb-webcam:  Error closing file pipe:: Invalid argument

not sure if there is anything in there that needs addressing to improve quality, or they can be ignored.

1 Like

real-time buffer [J5-CAPTURE] [video input] too full or near too full (69% of size: 3041280 [rtbufsize parameter])! frame dropped!

Fixed this one in new prerelease, h/t @Edwin_Perez

The default is bitrate=8000 but you can change that now too.

Updated server.

Set bitrate to 20000, That is much much better!

Latency is pretty bad, 3-4 secs, but i guess that is to be expected.

Won't be using this as a "remote desktop" or secondary desktop monitor, but, still has some possible uses for me.

Still lacking quality actually trying to use this as a secondary display...lol Not sure if it cause of Windows vs your Mac, or the capture card...or something else. Even at 25000 bit rate, static images looks good, but moving / play video is not great.

the 1920x1080 win desktop is also slightly cropped all around the edges.

maybe a chroma setting?

1 Like

@tmm1 Something changed on the server end. I can no longer run the command in cmd to list the devices.

C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe -list_devices true -f dshow -i dummy
Access is denied.

I get the blue pop up " This app can not run on this PC. To find a version for your pc, contact the software publisher."

In the CMD output, it just says "Access Denied"

I ddi try running CMD as Admin, same issue.

I plugged in a different webcam i have, and went to look for the device name, but ran in to this issue.

EDIT: I just copied the ffmpeg and things from the older server backups into a separate folder and path and used that for looking up devices in cmd.

@tmm1 I have not changed anything with my other m3u lines, i just added the new device....yet now, nothing is streaming and the server logs say this.

2025/02/24 13:01:20.571996 [ERR] Failed to start ffmpeg: fork/exec C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe: %1 is not a valid Win32 application.
2025/02/24 13:01:20.573141 [TNR] Opened connection to M3U-USBHDMICapture for ch1201 WYZE USB CAM
2025/02/24 13:01:20.573141 [ERR] Error during stream M3U-USBHDMICapture ch1201 WYZE USB CAM: read |0: file already closed
2025/02/24 13:01:20.573141 [TNR] Closed connection to M3U-USBHDMICapture for ch1201 WYZE USB CAM
2025/02/24 13:01:20.573748 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1201 WYZE USB CAM: buf=0% drop=0%
2025/02/24 13:01:52.206177 [ERR] Failed to start ffmpeg: fork/exec C:\ProgramData\ChannelsDVR\latest\ffmpeg.exe: %1 is not a valid Win32 application.
2025/02/24 13:01:52.206177 [TNR] Opened connection to M3U-USBHDMICapture for ch1200 USB Webcam
2025/02/24 13:01:52.206177 [ERR] Error during stream M3U-USBHDMICapture ch1200 USB Webcam: read |0: file already closed
2025/02/24 13:01:52.206836 [TNR] Closed connection to M3U-USBHDMICapture for ch1200 USB Webcam
2025/02/24 13:01:52.206836 [SNR] Buffer statistics for 192.168.0.17 (Apple TV) for ch1200 USB Webcam: buf=0% drop=0%

server version is still: 2025.02.24.1812
Commercial detection also failing now cause it uses ffmpeg.

Weird. Is the new prerelease any better?

Working again ....so far.

Must be missing a step on MacOS here. FWIW the swiches are different too
blah latest

% ./ffmpeg -devices             
Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 D  avfoundation    AVFoundation input device
 D  lavfi           Libavfilter virtual input device
blah latest % ./ffmpeg -sources avfoundation
Auto-detected sources for avfoundation:
Cannot list sources: Function not implemented

See:

1 Like