Article 6E1YB Capture audio and video from HDMI device with the same program using ALSA?

Capture audio and video from HDMI device with the same program using ALSA?

by
Jason_25
from LinuxQuestions.org on (#6E1YB)
I would like to capture audio and video from an HDMI capture device with the same program while using the ALSA audio system.

I have tried this in the past with VLC but it was not possible due to an ALSA bug. So I had to run two instances of VLC, one for audio and one for video.

I had this working with MPV up until a few days ago. Now there is no option to allow audio to sync with video with the existing capture card. No matter the command line options or settings it is always delayed. It has worked for years before this. Rebooting to fix is not an option. So I have purchased a new HDMI capture device. The new device only captures YUY2 at 5 fps so I changed to MJPEG and capture at 30 fps. Unfortunately, MPV now no longer can add the audio with --audio-file at start and cannot add audio through the IPC interface after it is running. It either cannot find the ALSA device or thinks I am giving it a video device. Without the video option for MJPEG audio works fine but video is at 5 fps. Posting on the Github issue tracker for MPV is unavailable to me because I have not compiled the latest version and I will not be able to continue using Github at all from the end of next month so I need to get used to having zero support from now on from all open source projects.

This does not have working audio:
Code:mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=input_format=mjpeg av://v4l2:/dev/video0 --audio-file=av://alsa:plughw:2,0This has working audio at 5 fps:
Code:mpv av://v4l2:/dev/video0 --audio-file=av://alsa:plughw:2,0I understand mplayer cannot capture from 2 separate devices at all. It is also not practical to move away from ALSA because of how complex the arrangement of audio devices is on this media system and because it will introduce all new problems. Everything with audio is working well except this problem.

Is there alternative software that will function? Or am I faced with tearing it all down and dealing with Pipewire or Pulseaudio? Or replacing the capture device with one that will do YUY2 at 30 fps like the old one? Or am I missing something with the mpv commands?
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments