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 >
>
~/Library/Application Support/ChannelsDVR/latest/ffmpeg
Okay getting close hopefully
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%
Just spins
2025/03/10 01:30:22.437841 [TNR] Opened connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/10 01:30:22.816777 [HLS] ffmpeg: capture-usb-hdmi: [video4linux2,v4l2 @ 0xf2a5680] Dequeued v4l2 buffer contains corrupted data (0 bytes).
2025/03/10 01:30:22.843060 [HLS] ffmpeg: capture-usb-hdmi: Guessed Channel Layout for Input Stream #1.0 : stereo
2025/03/10 01:30:22.843353 [HLS] ffmpeg: capture-usb-hdmi: [video4linux2,v4l2 @ 0xf2a5680] Dequeued v4l2 buffer contains corrupted data (0 bytes).
2025/03/10 01:30:22.853388 [HLS] ffmpeg: capture-usb-hdmi: Last message repeated 7 times
2025/03/10 01:30:22.853396 [HLS] ffmpeg: capture-usb-hdmi: [video4linux2,v4l2 @ 0xf2a5680] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
2025/03/10 01:30:22.853400 [HLS] ffmpeg: capture-usb-hdmi: [video4linux2,v4l2 @ 0xf2a5680] Dequeued v4l2 buffer contains corrupted data (0 bytes).
2025/03/10 01:30:23.562761 [HLS] ffmpeg: capture-usb-hdmi: Last message repeated 22 times
2025/03/10 01:30:23.562789 [HLS] ffmpeg: capture-usb-hdmi: [alsa @ 0xf2a75c0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 256)
2025/03/10 01:30:50.657294 [SNR] Buffer statistics for 192.168.1.131 (Casey’s iPhone) for ch201 USB HDMI Capture: buf=0% drop=0%
2025/03/10 01:30:50.657344 [ERR] Error during stream M3U-usbhdmi ch201 USB HDMI Capture: read |0: file already closed
2025/03/10 01:30:50.657351 [TNR] Closed connection to M3U-usbhdmi for ch201 USB HDMI Capture
2025/03/10 01:30:50.678512 [HLS] ffmpeg: capture-usb-hdmi: av_interleaved_write_frame(): Broken pipe
2025/03/10 01:30:50.703383 [HLS] ffmpeg: capture-usb-hdmi: Last message repeated 32 times
2025/03/10 01:30:50.703427 [HLS] ffmpeg: capture-usb-hdmi: Error writing trailer of pipe:: Broken pipe
2025/03/10 01:30:50.703435 [HLS] ffmpeg: capture-usb-hdmi: Error closing file pipe:: Broken pipe
No change - submitted dde049dc-181a-44ac-ae35-fd6563894310
capture://v4l2/video0
Using the device you linked, I can get video but no audio using Ubuntu 24.04.2. Video looks great!
I tried the last one you posted as well, but that just spins.
capture://v4l2/video0/hw:Video,0/?framerate=60
Hi, have you had any luck on getting the audio working? The picture is coming through perfect now.
Not with //capture. I get the same results as @timstephens24 above. I did find an hdmi audio stripper in my parts bin and I am having better results combining the separate audio with the video and streaming it to channels via m3u. It seems like Linux doesn’t like capturing the audio and video from the usb, it will capture one or the other but not both at the same time. I might share some scripts if I can get something working. I’m working on starting and stopping the m3u transcode based on when the channel is tuned in and out.
Sounds good thanks. Do you think I'd have better luck with a windows 11 pc? It's a shame that Linux doesn't like doing both. I get both in VLC. Fingers crossed you get something stable with the audio stripper