xTeVe icon indicating copy to clipboard operation
xTeVe copied to clipboard

"user_agent not found" when using ffmpeg

Open vquie opened this issue 4 years ago • 12 comments

Please first read the documentation. Problems affecting the client, e.g. Plex or Emby should be reported there in the forum.

Describe the bug When running the ffmpeg buffer, the stream fails with error "Option user_agent not found." I tried only using ffmpeg, don't know if the others still work.

ffmpeg started on 2020-12-20 at 19:23:22
Report written to "ffmpeg-20201220-192322.log"
Command line:
/usr/bin/ffmpeg -user_agent xTeVe -report -hide_banner -loglevel verbose -i "udp://@232.0.20.2:10000?sources=87.141.215.251" -c copy pipe:1
Splitting the commandline.
Reading option '-user_agent' ... matched as AVOption 'user_agent' with argument 'xTeVe'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'verbose'.
Reading option '-i' ... matched as input url with argument 'udp://@232.0.20.2:10000?sources=87.141.215.251'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option 'pipe:1' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument verbose.
Successfully parsed a group of options.
Parsing a group of options: input url udp://@232.0.20.2:10000?sources=87.141.215.251.
Successfully parsed a group of options.
Opening an input file: udp://@232.0.20.2:10000?sources=87.141.215.251.
[NULL @ 0x7f538bd4e780] Opening 'udp://@232.0.20.2:10000?sources=87.141.215.251' for reading
[udp @ 0x7f538ba10180] No default whitelist set
[udp @ 0x7f538ba10180] end receive buffer size reported is 131072
[mpegts @ 0x7f538bd4e780] Format mpegts probed with size=2048 and score=47
[mpegts @ 0x7f538bd4e780] stream=0 stream_type=1b pid=100 prog_reg_desc=
[mpegts @ 0x7f538bd4e780] stream=1 stream_type=6 pid=101 prog_reg_desc=
[mpegts @ 0x7f538bd4e780] stream=2 stream_type=6 pid=103 prog_reg_desc=
[mpegts @ 0x7f538bd4e780] stream=3 stream_type=5 pid=104 prog_reg_desc=
[mpegts @ 0x7f538bd4e780] stream=4 stream_type=6 pid=106 prog_reg_desc=
Option user_agent not found.

Server (please complete the following information):

  • OS [e.g. Linux - Ubuntu] Docker Container running on OpenMediaVault (Debian 10.7)
  • Arch [e.g. Intel 64 Bit] Intel 64 Bit
  • xTeVe Version and Build [to be found in the xTeVe log] 2.1.2 Build: 0121

To Reproduce Steps to reproduce the behavior: Run using ffmpeg buffer with these options -report -hide_banner -loglevel verbose -i [URL] -c copy pipe:1

Expected behavior I'd expect xteve to run the stream. Running the exact same command without the user_agent works in cli. Too bad the user_agent is hard coded in src/buffer.go.

vquie avatar Dec 20 '20 18:12 vquie

Reviewing the code I found out that leaving the user agent empty leaves the option. The issue is fixed for me.

vquie avatar Dec 20 '20 18:12 vquie

What version of FFmpeg are you using? The user_agent parameter has been around for a few years

mar-mei avatar Dec 22 '20 06:12 mar-mei

# ffmpeg -version
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9.2.0 (Alpine 9.2.0)
configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libass --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-libxcb --disable-stripping --disable-static --disable-librtmp --enable-vaapi --enable-vdpau --enable-libopus --disable-debug
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

vquie avatar Dec 22 '20 07:12 vquie

# ffmpeg -version
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-avresample --cc=cc --cxx=c++ --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --enable-libaom --disable-libaribb24 --enable-asm --enable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcelt --disable-libcodec2 --enable-libdav1d --disable-libdavs2 --disable-libdc1394 --disable-debug --enable-htmlpages --enable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-gcrypt --disable-libglslang --disable-libgme --enable-gmp --enable-gnutls --enable-version3 --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libklvanc --disable-libkvazaar --disable-ladspa --enable-libmp3lame --disable-liblensfun --disable-libbluray --disable-librsvg --disable-librtmp --enable-libxml2 --disable-lto --disable-lv2 --disable-mbedtls --disable-libmfx --disable-libmodplug --disable-libmysofa --disable-nonfree --disable-openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh264 --disable-libopenjpeg --disable-libopenmpt --disable-openssl --enable-optimizations --enable-libopus --disable-pocketsphinx --disable-libpulse --disable-librabbitmq --disable-librav1e --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --disable-libsrt --disable-libssh --disable-libtensorflow --disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 --enable-vaapi --disable-vapoursynth --enable-vdpau --disable-libvidstab --disable-libvmaf --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-vulkan --disable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxavs2 --enable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

I think from 4.3.0 the option was added.

mar-mei avatar Dec 22 '20 07:12 mar-mei

Are you running the docker container? I just removed the images and and started from scratch. Again..... 4.2.1.

vquie avatar Dec 22 '20 08:12 vquie

I don't use docker. Who created the Docker container?

mar-mei avatar Dec 22 '20 08:12 mar-mei

This ist the one I use: https://github.com/alturismo/xteve

The latest version I am able to get is 4.2.4.

vquie avatar Dec 22 '20 08:12 vquie

Does it work with 4.2.4? The user agent is only important if the default user agent is blocked.

mar-mei avatar Dec 22 '20 12:12 mar-mei

Nope, does not work in 4.2.4.

ffmpeg started on 2020-12-23 at 10:04:53
Report written to "ffmpeg-20201223-100453.log"
Command line:
/usr/bin/ffmpeg -user_agent xTeve -report -hide_banner -loglevel error -i "udp://@232.0.20.234:10000?sources=87.141.215.251" -c copy -f mpegts pipe:1
Splitting the commandline.
Reading option '-user_agent' ... matched as AVOption 'user_agent' with argument 'xTeve'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'error'.
Reading option '-i' ... matched as input url with argument 'udp://@232.0.20.234:10000?sources=87.141.215.251'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'mpegts'.
Reading option 'pipe:1' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument error.
Successfully parsed a group of options.
Parsing a group of options: input url udp://@232.0.20.234:10000?sources=87.141.215.251.
Successfully parsed a group of options.
Opening an input file: udp://@232.0.20.234:10000?sources=87.141.215.251.
[NULL @ 0x7fa0bb447780] Opening 'udp://@232.0.20.234:10000?sources=87.141.215.251' for reading
[udp @ 0x7fa0bb109180] No default whitelist set
[udp @ 0x7fa0bb109180] end receive buffer size reported is 131072
[mpegts @ 0x7fa0bb447780] Format mpegts probed with size=2048 and score=47
[mpegts @ 0x7fa0bb447780] Unable to seek back to the start
[mpegts @ 0x7fa0bb447780] stream=0 stream_type=1b pid=100 prog_reg_desc=
[mpegts @ 0x7fa0bb447780] stream=1 stream_type=6 pid=101 prog_reg_desc=
[mpegts @ 0x7fa0bb447780] stream=2 stream_type=6 pid=103 prog_reg_desc=
[mpegts @ 0x7fa0bb447780] stream=3 stream_type=5 pid=104 prog_reg_desc=
[mpegts @ 0x7fa0bb447780] stream=4 stream_type=6 pid=106 prog_reg_desc=
[mpegts @ 0x7fa0bb447780] Unable to seek back to the start
Option user_agent not found.

vquie avatar Dec 23 '20 09:12 vquie

I'm running 4.4.1 and I am also having this problem

yash-fn avatar Jan 17 '22 16:01 yash-fn

Same problem with static macOS binaries. Version: 5.1.2-tessus

➜  ~ ffmpeg -i "https://example.com" -user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0" -c:v copy -bsf:a aac_adtstoasc ./out.mp4
ffmpeg version 5.1.2-tessus Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100

Unrecognized option 'user-agent'.
Error splitting the argument list: Option not found

nickyfoster avatar Jan 29 '23 15:01 nickyfoster

**ffmpeg is a independent app. I beleive they have a website for reporting errors, we have no control over it.

MCTyler avatar Jan 31 '23 06:01 MCTyler