USB HDMI Capture

Would it be possible for the logs to ignore these lines? It creates thousands of these lines in the logs when streaming.


2025/03/20 17:02:40.822663 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294074063, next:13449462 st:0 invalid dropping
2025/03/20 17:02:40.822677 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294074063, next:13449462 invalid dropping st:0
2025/03/20 17:02:40.844102 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294090727, next:13466128 st:0 invalid dropping
2025/03/20 17:02:40.844162 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294090727, next:13466128 invalid dropping st:0
2025/03/20 17:02:40.855191 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294107399, next:13482794 st:0 invalid dropping
2025/03/20 17:02:40.855206 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294107399, next:13482794 invalid dropping st:0
2025/03/20 17:02:40.866359 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294124053, next:13499460 st:0 invalid dropping
2025/03/20 17:02:40.866379 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294124053, next:13499460 invalid dropping st:0
2025/03/20 17:02:40.887549 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294140717, next:13516126 st:0 invalid dropping
2025/03/20 17:02:40.887639 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294140717, next:13516126 invalid dropping st:0
2025/03/20 17:02:40.909010 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294157389, next:13532792 st:0 invalid dropping
2025/03/20 17:02:40.909041 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294157389, next:13532792 invalid dropping st:0
2025/03/20 17:02:40.920227 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294174044, next:13549458 st:0 invalid dropping
2025/03/20 17:02:40.920232 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294174044, next:13549458 invalid dropping st:0
2025/03/20 17:02:40.941514 [HLS] ffmpeg: capture-usb-hdmi:  DTS 927294190707, next:13566124 st:0 invalid dropping
2025/03/20 17:02:40.941517 [HLS] ffmpeg: capture-usb-hdmi:  PTS 927294190707, next:13566124 invalid dropping st:0

Here's the error I'm getting with

#EXTM3U
#EXTINF:-1, channel-id="camera",USB Capture
capture://dshow/C36 Video/Digital Audio Interface (C36 Audio)/?framerate=60&video_size=1920x1080

Log:

2025/03/21 08:24:06.890052 [TNR] Opened connection to M3U-USBCapture for ch9005 USB Capture
2025/03/21 08:24:06.890052 [HLS] Starting live stream for channel 9005 from 10.10.12.25
2025/03/21 08:24:07.103618 [HLS] ffmpeg: capture-camera:  [aist#0:1/pcm_s16le @ 0000020a522f7f40] Guessed Channel Layout: stereo
2025/03/21 08:24:07.104146 [HLS] ffmpeg: capture-camera:  [vost#0:0/h264_mf @ 0000020a522fab80] -enc_time_base -1 is deprecated, use -enc_timebase demux
2025/03/21 08:24:07.104146 [HLS] ffmpeg: capture-camera:  [aost#0:1/aac @ 0000020a522fec80] -enc_time_base -1 is deprecated, use -enc_timebase demux
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  [Eval @ 000000c6119fdb40] Undefined constant or missing '(' in 'prev_t))'
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  [Eval @ 000000c6119fdb40] Missing ')' or too many args in 'gt(floor(t),floor(prev_t))'
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  [vost#0:0/h264_mf @ 0000020a522fab80] Invalid force_key_frames expression 'gt(floor(t),floor(prev_t))'
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  [out#0/mpegts @ 0000020a522e37c0] Error processing forced keyframes
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  Error opening output file -.
2025/03/21 08:24:07.104655 [HLS] ffmpeg: capture-camera:  Error opening output files: Invalid argument
2025/03/21 08:24:07.134117 [ERR] Error during stream M3U-USBCapture ch9005 USB Capture: exit status 0xffffffea
2025/03/21 08:24:07.134117 [TNR] Closed connection to M3U-USBCapture for ch9005 USB Capture
2025/03/21 08:24:07.134117 [HLS] ffmpeg: ch9005-dANY-ip10.10.12.25-remux:  [in#0/mpegts @ 000001dc36887bc0] could not find codec parameters
2025/03/21 08:24:07.134117 [HLS] ffmpeg: ch9005-dANY-ip10.10.12.25-remux:  Error opening input file -.
2025/03/21 08:24:07.134117 [HLS] ffmpeg: ch9005-dANY-ip10.10.12.25-remux:  Error opening input files: End of file
2025/03/21 08:24:16.933664 [ERR] Probe failed for live stream after 10.0424215s and 0 bytes
2025/03/21 08:24:17.198732 [HLS] Couldn't generate stream playlist for ch9005-dANY-ip10.10.12.25: Couldn't find playlist: C:\-- Channels DVR\Streaming\ch9005-dANY-ip10.10.12.25-2668537006\remux\stream.m3u8: CreateFile C:\-- Channels DVR\Streaming\ch9005-dANY-ip10.10.12.25-2668537006\remux\stream.m3u8: The system cannot find the file specified.
2025/03/21 08:24:17.198732 [HLS] Stopping transcoder session ch9005-dANY-ip10.10.12.25 (out=0s finished=true first_seq=0 last_seq=-1)

HDMI Capture works fine in VLC. Any help greatly appreciated, thanks!

Update prerelease

That worked, thanks!

Ok so it randomly started working today. Then I did a bit of cable management and it stopped working again and I now have to reconnect every time I want to stream. Having the same error log as before. @tmm1

Make sure you are using a blue usb 3.0 port.

Most of those USB Capture devices even though they have a blue plug are really USB 2.0... they are fake USB 3.0.

Here is a screenshot of my card that Claims to be 3.0 and has a blue Cable....

Thanks @Rice The framefate dropped from 60 to 20fps on an i7 nuc running linux. It was in a usb 3/ lightning port when it was working at 60fps. tried a in a blue usb 3.0 and drops to 20 fps and stops working too.

1 Like

I think you mean Thunderbolt.

Thanks yes I did mean that :slight_smile:

Mabey it’s a Linux limitation thing then. I accidentally plugged it into a usb2.0 on the back of my motherboard and I got 9fps max. It wouldn’t work in channels until it was back on 3.0. Ymmv

@tmm1 Any joy in stopping it from spinning after a successful stream? I thought maybe make the script disconnect from the HDMI dongle when a stream closes. Like a software version of pulling the usb out and back in

@tmm1
Is there anything you can do about these errors in the logs? I have hundreds of thousands of these lines when the capture is active making it impossible to find anything in the logs. 100-150 of these lines a second.


2025/03/24 11:27:50.801386 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804028406, next:533312 invalid dropping st:0
2025/03/24 11:27:50.802936 [HLS] ffmpeg: capture-usb-hdmi:  DTS 1252804045070, next:549978 st:0 invalid dropping
2025/03/24 11:27:50.802975 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804045070, next:549978 invalid dropping st:0
2025/03/24 11:27:50.815313 [HLS] ffmpeg: capture-usb-hdmi:  DTS 1252804061741, next:566644 st:0 invalid dropping
2025/03/24 11:27:50.815373 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804061741, next:566644 invalid dropping st:0
2025/03/24 11:27:50.836848 [HLS] ffmpeg: capture-usb-hdmi:  DTS 1252804078397, next:583310 st:0 invalid dropping
2025/03/24 11:27:50.836856 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804078397, next:583310 invalid dropping st:0
2025/03/24 11:27:50.858475 [HLS] ffmpeg: capture-usb-hdmi:  DTS 1252804095061, next:599976 st:0 invalid dropping
2025/03/24 11:27:50.858509 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804095061, next:599976 invalid dropping st:0
2025/03/24 11:27:50.880197 [HLS] ffmpeg: capture-usb-hdmi:  DTS 1252804111730, next:616642 st:0 invalid dropping
2025/03/24 11:27:50.880230 [HLS] ffmpeg: capture-usb-hdmi:  PTS 1252804111730, next:616642 invalid dropping st:0

Thank you!!

Thank you again for getting this to work on Linux. The only issue I am facing now is an audio video syncing issue. Is there anything that can be done to improve it? It's not horrendous but noticeable :slight_smile: Thank you again for your hard work.

Hi @tmm1 I found this about ffmpeg. Might this help my syncing issues?

  1. Correct FFmpeg Sync Audio to Video That is Too Fast or Slow
    You can easily do this by using the -async parameter of FFmpeg, which, as per the documentation "Stretches/squeezes" enables the sound stream to match the timestamps. The parameter takes a numeric value for the samples per second to fix the issue.

ffmpeg -async 25 -i input.mpg -r 25

Attempt gradually expanding the - async value until the sound and video are in sync.

Many thanks

Still scratching my head at this - @tmm1 are you running your mac DVR manually? It's just so odd that yours worked straight away on post 1, and everyone else has the same issue as the quoted post.

@tmm1 I'm getting a strange error on the latest pre-release. Hoping you can point me in the right direction.

2025/04/05 13:11:40.798882 [TNR] Opened connection to M3U-USBHDMICapture for ch11634 USB HDMI Capture
2025/04/05 13:11:40.798882 [HLS] Starting live stream for channel 11634 from 192.168.50.149
2025/04/05 13:11:41.872075 [HLS] ffmpeg: capture-usb-hdmi:  [aist#0:1/pcm_s16le @ 00000211575f9e00] Guessed Channel Layout: stereo
2025/04/05 13:11:41.872075 [HLS] ffmpeg: capture-usb-hdmi:  [vost#0:0/h264_nvenc @ 00000211575eaec0] -enc_time_base -1 is deprecated, use -enc_timebase demux
2025/04/05 13:11:41.975603 [HLS] ffmpeg: capture-usb-hdmi:  [aost#0:1/aac @ 000002115c82e740] -enc_time_base -1 is deprecated, use -enc_timebase demux
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:  Failed to negotiate pixel format between 'graph 0 input from stream 0:0' and 'auto_scale_0':
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      graph 0 input from stream 0:0 (buffer)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↓ yuyv422
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↑ yuyv422
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      auto_scale_0 (scale)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↓ yuv420p, yuyv422, rgb24 (+183 more)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ⚠️ hwupload needed ⚠️
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↑ cuda
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      Parsed_scale_cuda_0 (scale_cuda) [requires cuda]
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↓ cuda
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↑ yuv420p, nv12, p010le (+13 more)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      format
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↓ yuv420p, nv12, p010le (+13 more)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      ↑ yuv420p, yuyv422, rgb24 (+227 more)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:      out_0_0 (buffersink)
2025/04/05 13:11:41.977689 [HLS] ffmpeg: capture-usb-hdmi:  Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scale_0'
2025/04/05 13:11:41.978220 [HLS] ffmpeg: capture-usb-hdmi:  [vf#0:0 @ 00000211579ba800] Error reinitializing filters!
2025/04/05 13:11:41.978220 [HLS] ffmpeg: capture-usb-hdmi:  Failed to inject frame into filter network: Function not implemented
2025/04/05 13:11:41.978220 [HLS] ffmpeg: capture-usb-hdmi:  Error while filtering: Function not implemented
2025/04/05 13:11:41.979813 [HLS] ffmpeg: capture-usb-hdmi:  [out#0/mpegts @ 00000211576f3b40] Nothing was written into output file, because at least one of its streams received no packets.
2025/04/05 13:11:42.036382 [ERR] Error during stream M3U-USBHDMICapture ch11634 USB HDMI Capture: exit status 0xffffffd8
2025/04/05 13:11:42.036382 [TNR] Closed connection to M3U-USBHDMICapture for ch11634 USB HDMI Capture
2025/04/05 13:11:42.036382 [HLS] ffmpeg: ch11634-dANY-ip192.168.50.149-remux:  [in#0/mpegts @ 000002a6e1343480] could not find codec parameters
2025/04/05 13:11:42.036382 [HLS] ffmpeg: ch11634-dANY-ip192.168.50.149-remux:  Error opening input file -.
2025/04/05 13:11:42.036382 [HLS] ffmpeg: ch11634-dANY-ip192.168.50.149-remux:  Error opening input files: End of file
2025/04/05 13:11:42.041941 [HLS] Stopping transcoder session ch11634-dANY-ip192.168.50.149 (out=0s finished=true first_seq=0 last_seq=-1)
2025/04/05 13:11:42.042625 [ERR] Probe cancelled for live stream after 1.24321s and 0 bytes

this worked with pre-release 2025.03.01.2019
Changed from video_size=1920x1080 to video_size=1280x720 resolved the issue.

Hey @turtletank - any chance that one of these would possibly bypass this camera classification? (even if the price stings)

Otherwise, we're kind of stuck on mac until @tmm1 works some magic here.

There are some less expensive ($15.99) versions available

$13.99

But I don't think they'll do HDMI to USB C capture, only USB C to HDMI output.