AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.21k stars 344 forks source link

# in ffmpeg Device Name #1259

Open DerJimmyJere opened 1 month ago

DerJimmyJere commented 1 month ago

Hey,

I have the following Problem with implementing a videostream from a ffmpeg Device with the Name: FH8735 PCI, Analog Capture (#01) My config and everything worked fine with devices, that doesnt have a # in it but now it stops reading the name at the # and thinks 01) is a parameter or sth like that. How can I say the config, that the # is part of the string (device name) and not a parameter-introduction? " bevore and after the device name didnt work (malformed input string).

complete config:

streams:
  stream_1: ffmpeg:device?video=FH8735 PCI, Analog Capture (#01)#video=h264
  stream_2: ffmpeg:device?video=FH8735 PCI, Analog Capture (#02)#video=h264
  stream 3: ffmpeg:device?video=FH8735 PCI, Analog Capture (#03)#video=h264
  stream 4: ffmpeg:device?video=FH8735 PCI, Analog Capture (#04)#video=h264

I would appreciate an answer :) Have a good day Jere

AlexxIT commented 1 month ago

What OS do you have? If it is Windows, you can use device IDs. You just need to get them somehow...

DerJimmyJere commented 1 month ago

Hi AlexxIT thanks for ur fast response :) Im using windows. ffmpeg is showing me:

ffmpeg -list_devices true -f dshow -i dummy
ffmpeg version 2023-08-07-git-d295b6b693-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 14.100 / 58. 14.100
  libavcodec     60. 22.100 / 60. 22.100
  libavformat    60. 10.100 / 60. 10.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9. 10.100 /  9. 10.100
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog Capture (#02)" (video)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&13a41564&0&2000100009#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{6f814be9-9af6-43cf-9249-c0340200021a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog Capture (#01)" (video)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&2582f3fe&0&2000080009#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{6f814be9-9af6-43cf-9249-c0340100021a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog Capture (#04)" (video)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&19c3fe69&0&2000200009#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{6f814be9-9af6-43cf-9249-c0340400021a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog Capture (#03)" (video)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&2ec2f344&0&2000180009#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{6f814be9-9af6-43cf-9249-c0340300021a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog WaveIn (#04)" (audio)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&19c3fe69&0&2000200009#{33d9a762-90c8-11d0-bd43-00a0c911ce86}\{6f814be9-9af6-43cf-9249-c0340400031a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog WaveIn (#03)" (audio)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&2ec2f344&0&2000180009#{33d9a762-90c8-11d0-bd43-00a0c911ce86}\{6f814be9-9af6-43cf-9249-c0340300031a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog WaveIn (#02)" (audio)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&13a41564&0&2000100009#{33d9a762-90c8-11d0-bd43-00a0c911ce86}\{6f814be9-9af6-43cf-9249-c0340200031a}"
[dshow @ 000002c606bacf40] "FH8735 PCI, Analog WaveIn (#01)" (audio)
[dshow @ 000002c606bacf40]   Alternative name "@device_pnp_\\?\pci#ven_3086&dev_0101&subsys_00000000&rev_00#7&2582f3fe&0&2000080009#{33d9a762-90c8-11d0-bd43-00a0c911ce86}\{6f814be9-9af6-43cf-9249-c0340100031a}"
[in#0 @ 000002c606b9a3c0] Error opening input: Immediate exit requested
Error opening input file dummy.

What do you mean with device-id?

AlexxIT commented 1 month ago

Device ID is alternative name: https://ffmpeg.org/ffmpeg-devices.html#dshow But they also has # symbol in your case...

Change names to indexes. Not best solution, because indexes can be random after reboots.

streams:
  stream_1: ffmpeg:device?video=1#video=h264
  stream_2: ffmpeg:device?video=0#video=h264
  stream_3: ffmpeg:device?video=3#video=h264
  stream_4: ffmpeg:device?video=2#video=h264
DerJimmyJere commented 1 month ago

Ok thank you Ive solved the problem in a different way. Ive changed the ffmpeg-device name like it is described in the following documentation: link But thank you for your fast response :)

AlexxIT commented 1 month ago

It's a good solution. It makes sense to add it to the documentation.