USB HDMI Capture

Try this w/ next build:

#EXTM3U
#EXTINF:-1, channel-id="usb-hdmi",USB HDMI Capture
capture://v4l2/video0/hw:Video,0/?framerate=60
1 Like

Both 2019 and 2037 error with


2025/03/06 14:52:35.593192 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/06 14:52:35.595391 [HLS] ffmpeg: capture-usb-hdmi:  Unknown input format: 'alsa'
2025/03/06 14:52:35.595741 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: exit status 1
2025/03/06 14:52:35.595754 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/06 14:52:35.595794 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%

2119
Same log errors

Still same on Mac (assumingly due to capture device perms)

Fresh diagnostics on 61d5aa07-d474-4bc8-9300-7db8f867452d .

I am still unable to get the sound to come through my Linux setup but I see others are having the same issue. I tried the latest config in the post and got the exact same error messages so that is promising.

I have made progress and created a home assistant automation that is based on a sensor that detects the channel number in Channels DVR and will then run a script to change the channel via a RF blaster.

Try this one:

No video or audio on 2051


2025/03/09 17:05:52.077460 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 17:05:52.086256 [HLS] ffmpeg: capture-usb-hdmi:  ALSA lib /home/vagrant/channels-server/ext/alsa-lib/src/conf.c:4580:(snd_config_update_r) Cannot access file /home/vagrant/channels-server/ext/dst/linux-x86_64/share/alsa/alsa.conf
2025/03/09 17:05:52.086279 [HLS] ffmpeg: capture-usb-hdmi:  ALSA lib /home/vagrant/channels-server/ext/alsa-lib/src/pcm/pcm.c:2722:(snd_pcm_open_noupdate) Unknown PCM hw:Video,0
2025/03/09 17:05:52.086281 [HLS] ffmpeg: capture-usb-hdmi:  [alsa @ 0x26876700] cannot open audio device hw:Video,0 (No such file or directory)
2025/03/09 17:05:52.086285 [HLS] ffmpeg: capture-usb-hdmi:  hw:Video,0: Input/output error
2025/03/09 17:05:52.086687 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: exit status 1
2025/03/09 17:05:52.086697 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 17:05:52.086742 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%

1 Like

Which audio output is preferred from the usb capture device? Analog or digital?

Does the USB capture device have an input port for Toslink or SPDIF otherwise? That could be interesting with regard to multi-channel (more than 2) audio. Actually, could the video be captured by the USB capture device and the audio brought in on the PC's SPDIF.

dunno, what do arecord -l and arecord -L show

I have the capture device linked in the first post. It doesn’t have optical outputs on it. It can output either analog or digital via the usb port. Most pc do not have an optical input. If my pc had an optical input I would have tried an hdmi audio stripper.


rice@amd:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Video [USB3 Video], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 0: ALC897 Analog [ALC897 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Generic_1 [HD-Audio Generic], device 2: ALC897 Alt Analog [ALC897 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
rice@amd:~$ arecord -L 
null
    Discard all samples (playback) or generate zero samples (capture)
default
    Playback/recording through the PulseAudio sound server
samplerate
    Rate Converter Plugin Using Samplerate Library
speexrate
    Rate Converter Plugin Using Speex Resampler
jack
    JACK Audio Connection Kit
oss
    Open Sound System
pulse
    PulseAudio Sound Server
upmix
    Plugin for channel upmix (4,6,8)
vdownmix
    Plugin for channel downmix (stereo) with a simple spacialization
usbstream:CARD=Generic
    HD-Audio Generic
    USB Stream Output
hw:CARD=Video,DEV=0
    USB3 Video, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Video,DEV=0
    USB3 Video, USB Audio
    Hardware device with all software conversions
sysdefault:CARD=Video
    USB3 Video, USB Audio
    Default Audio Device
front:CARD=Video,DEV=0
    USB3 Video, USB Audio
    Front output / input
dsnoop:CARD=Video,DEV=0
    USB3 Video, USB Audio
    Direct sample snooping device
usbstream:CARD=Video
    USB3 Video
    USB Stream Output
hw:CARD=Generic_1,DEV=0
    HD-Audio Generic, ALC897 Analog
    Direct hardware device without any conversions
hw:CARD=Generic_1,DEV=2
    HD-Audio Generic, ALC897 Alt Analog
    Direct hardware device without any conversions
plughw:CARD=Generic_1,DEV=0
    HD-Audio Generic, ALC897 Analog
    Hardware device with all software conversions
plughw:CARD=Generic_1,DEV=2
    HD-Audio Generic, ALC897 Alt Analog
    Hardware device with all software conversions
sysdefault:CARD=Generic_1
    HD-Audio Generic, ALC897 Analog
    Default Audio Device
front:CARD=Generic_1,DEV=0
    HD-Audio Generic, ALC897 Analog
    Front output / input
dsnoop:CARD=Generic_1,DEV=0
    HD-Audio Generic, ALC897 Analog
    Direct sample snooping device
dsnoop:CARD=Generic_1,DEV=2
    HD-Audio Generic, ALC897 Alt Analog
    Direct sample snooping device
usbstream:CARD=Generic_1
    HD-Audio Generic
    USB Stream Output
rice@amd:~$ 

Try this

I get audio but no video, just a black screen


2025/03/09 20:54:32.779003 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 20:54:33.024852 [HLS] ffmpeg: capture-usb-hdmi:  Guessed Channel Layout for Input Stream #0.0 : stereo
2025/03/09 20:54:33.368489 [HLS] ffmpeg: capture-usb-hdmi:  Codec AVOption g (set the group of picture (GOP) size) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
2025/03/09 20:54:33.368504 [HLS] ffmpeg: capture-usb-hdmi:  Codec AVOption preset (Set the encoding preset (cf. x264 --fullhelp)) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
2025/03/09 20:54:33.368510 [HLS] ffmpeg: capture-usb-hdmi:  Codec AVOption x264opts (x264 options) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
2025/03/09 20:54:33.368512 [HLS] ffmpeg: capture-usb-hdmi:  Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (pipe:) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
2025/03/09 20:54:33.378692 [HLS] ffmpeg: capture-usb-hdmi:  [alsa @ 0x446d6700] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
2025/03/09 20:54:33.379714 [HLS] ffmpeg: capture-usb-hdmi:  [mpegts @ 0x446dc380] frame size not set
2025/03/09 20:54:42.467143 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%
2025/03/09 20:54:42.467171 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: read |0: file already closed
2025/03/09 20:54:42.467176 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 20:54:42.488250 [HLS] ffmpeg: capture-usb-hdmi:  av_interleaved_write_frame(): Broken pipe
2025/03/09 20:54:42.490647 [HLS] ffmpeg: capture-usb-hdmi:  [video4linux2,v4l2 @ 0x446da0c0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
2025/03/09 20:54:42.491132 [HLS] ffmpeg: capture-usb-hdmi:  av_interleaved_write_frame(): Broken pipe
2025/03/09 20:54:42.491374 [HLS] ffmpeg: capture-usb-hdmi:      Last message repeated 1 times
2025/03/09 20:54:42.491377 [HLS] ffmpeg: capture-usb-hdmi:  Error writing trailer of pipe:: Broken pipe
2025/03/09 20:54:42.491379 [HLS] ffmpeg: capture-usb-hdmi:  Error closing file pipe:: Broken pipe

Does it help if you:

macOS > System Settings > Privacy & Security > Screen & Audio System Recording > :heavy_plus_sign: > ~/Library/Application Support/ChannelsDVR/latest/ffmpeg

Okay getting close hopefully

1 Like

No video no audio. Timeout after 32sec


2025/03/09 23:04:24.590472 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 23:04:24.592403 [HLS] ffmpeg: capture-usb-hdmi:  [video4linux2,v4l2 @ 0x3bf0c680] Cannot open video device /dev/video0: No such file or directory
2025/03/09 23:04:24.592421 [HLS] ffmpeg: capture-usb-hdmi:  /dev/video0: No such file or directory
2025/03/09 23:04:24.592682 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: exit status 1
2025/03/09 23:04:24.592692 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 23:04:24.592747 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%

Not sure about that one. Maybe the device needs to be replugged?

We're planning some upgrades soon that will hopefully address the issue you noted where its not closing.

Restarted machine and replugged in the card. At least it’s finding video0 again. Still times out after 32sec.


2025/03/09 23:28:50.318669 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 23:28:50.911155 [HLS] ffmpeg: capture-usb-hdmi:  Option enc_time_base (set the desired time base for the encoder (1:24, 1:48000 or 0.04166, 2.0833e-5). two special values are defined - 0 = use frame rate (video) or sample rate (audio),-1 = match source time base) cannot be applied to input url hw:Video,0 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
2025/03/09 23:28:50.911187 [HLS] ffmpeg: capture-usb-hdmi:  Error parsing options for input file hw:Video,0.
2025/03/09 23:28:50.911188 [HLS] ffmpeg: capture-usb-hdmi:  Error opening input files: Invalid argument
2025/03/09 23:28:50.911190 [HLS] ffmpeg: capture-usb-hdmi:  [video4linux2,v4l2 @ 0x344e4680] Some buffers are still owned by the caller on close.
2025/03/09 23:28:50.916223 [HLS] ffmpeg: capture-usb-hdmi:  ioctl(VIDIOC_QBUF): Bad file descriptor
2025/03/09 23:28:50.916978 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: exit status 1
2025/03/09 23:28:50.916997 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/09 23:28:50.917091 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%