You are not logged in.

#1 2021-11-28 17:13:14

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 317

FFPLAY play video and audio together

hello folks,
i can't play video+audio of my USB Video Capture Card:

$ ffplay -f v4l2 -i /dev/video0 -f pulse -i alsa_input.usb-MACROSIL_AV_TO_USB2.0-02.mono-fallback

ffplay version n4.4 Copyright (c) 2003-2021 the FFmpeg developers
  built with gcc 11.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Argument 'alsa_input.usb-MACROSIL_AV_TO_USB2.0-02.mono-fallback' provided as input filename, but '/dev/video0' was already specified.

How can i solve? alternatively could i use mpv?


sorry for my bad english

Offline

#2 2021-11-29 02:15:37

duing
Member
Registered: 2021-11-28
Posts: 7

Re: FFPLAY play video and audio together

multiple video input sources, omit -i dev/video

Offline

#3 2021-11-29 10:38:14

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 317

Re: FFPLAY play video and audio together

duing wrote:

multiple video input sources, omit -i dev/video

without -i dev/video i only hear audio. i want to play both video and audio.


sorry for my bad english

Offline

#4 2021-11-29 11:54:32

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,285

Re: FFPLAY play video and audio together

-i alsa_input.usb-MACROSIL_AV_TO_USB2.0-02.mono-fallback is providing the audio, right ?

If so, try -f alsa instead of -f pulse.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2021-11-29 12:27:21

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 317

Re: FFPLAY play video and audio together

with -f pulse i hear audio. with -f alsa i doesn't hear it.

with ffmpeg, recording works good. i use this command:

ffmpeg -y -f v4l2 -standard PAL -thread_queue_size 1024 -i /dev/video0 -f pulse -i alsa_input.usb-MACROSIL_AV_TO_USB2.0-02.mono-fallback -f avi  -vsync 1 -async 1 -r 30 -vcodec libx264 -preset superfast -crf 23 -s 720x480 -acodec libmp3lame -b:a 128k -channels 2 -ar 44100 /tmp/output.mp4

sorry for my bad english

Offline

#6 2021-11-29 14:03:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,944

Re: FFPLAY play video and audio together

I'd say this is normal, afaik ffplay isn't really intended to do on the fly muxing/combining. What you could possibly do is to pipe this into stdout and ffplay from that if you don't want to create a temp file.

Online

#7 2021-11-29 15:54:03

duing
Member
Registered: 2021-11-28
Posts: 7

Re: FFPLAY play video and audio together

With stdout I had to specify a container format. I get better performance with alsa.

ffmpeg -i /dev/video0 -f alsa -i pulse -c copy -f matroska - |ffplay -

Offline

Board footer

Powered by FluxBB