Project

General

Profile

IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router.

Added by DS Kim over 5 years ago

Version of TVHeadend?

I Tested...

4.2.3
4.2.7
4.2.8

Running on what OS and version?

Linux ROUTER 2.6.36.4brcmarm #1 SMP PREEMPT Sun Mar 24 17:44:13 EDT 2019 armv7l ASUSWRT-Merlin
more info : https://openwrt.org/toh/asus/rt-ac68u

Package that came with the OS or something you compiled yourself?

I compiled with the below options.

Configure arguments:
  --target=arm-openwrt-linux --host=arm-openwrt-linux --build=x86_64-pc-linux-gnu --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var --mandir=/opt/man --infodir=/opt/info --disable-nls --disable-cwc --disable-linuxdvb --disable-dvbscan --disable-avahi --arch=arm --disable-dbus_1 --disable-libav --disable-ffmpeg_static --disable-cccam --disable-libx264 --disable-capmt --disable-constcw --disable-satip_server --disable-satip_client --enable-bundle

Compiler:
  Using C compiler:                        arm-openwrt-linux-gnueabi-gcc
  Using C flags:                           -O2 -pipe -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=soft  -I/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/include -I/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/include -Wno-error=misleading-indentation
  Using LD flags:                          -L/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -L/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link=/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/home/cwdt/Entware-ng/staging_dir/toolchain-arm_cortex-a9_gcc-6.3.0_glibc-2.23_eabi/usr/lib -L/home/cwdt/Entware-ng/staging_dir/toolchain-arm_cortex-a9_gcc-6.3.0_glibc-2.23_eabi/lib -L/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/lib -Wl,-rpath-link=/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libiconv-full/lib -L/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/lib -Wl,-rpath-link=/home/cwdt/Entware-ng/staging_dir/target-arm_cortex-a9_glibc-2.23_eabi/opt/lib/libintl-full/lib
  Build for arch:                          arm

Binaries:
  Using PYTHON:                            python
  Using GZIP:                              gzip
  Using BZIP2:                             bzip2

Options:
  pie                                      yes
  ccdebug                                  no
  cwc                                      no
  capmt                                    no
  constcw                                  no
  linuxdvb                                 no
  satip_server                             no
  satip_client                             no
  hdhomerun_client                         yes
  hdhomerun_static                         yes
  iptv                                     yes
  tsfile                                   yes
  dvbscan                                  no
  timeshift                                yes
  trace                                    yes
  imagecache                               yes
  avahi                                    no
  zlib                                     yes
  libav                                    no
  ffmpeg_static                            no
  libx264                                  no
  libx264_static                           yes
  libx265                                  yes
  libx265_static                           yes
  libvpx                                   yes
  libvpx_static                            yes
  libtheora                                yes
  libtheora_static                         yes
  libvorbis                                yes
  libvorbis_static                         yes
  libfdkaac                                yes
  libfdkaac_static                         yes
  nvenc                                    no
  qsv                                      no
  libmfx_static                            yes
  inotify                                  yes
  epoll                                    yes
  uriparser                                no
  ccache                                   no
  tvhcsa                                   no
  bundle                                   yes
  pngquant                                 no
  dvbcsa                                   no
  dvben50221                               no
  kqueue                                   no
  dbus_1                                   no
  android                                  no
  tsdebug                                  no
  gtimer_check                             no
  slow_memoryinfo                          no
  libsystemd_daemon                        no
  pcloud_cache                             yes
  execinfo                                 yes
  W_unused_result                          yes
  fdatasync                                yes
  getloadavg                               yes
  atomic32                                 yes
  atomic64                                 yes
  atomic_time_t                            yes
  bitops64                                 yes
  lockowner                                yes
  qsort_r                                  yes
  stime                                    yes
  gmtoff                                   yes
  recvmmsg                                 yes
  sendmmsg                                 yes
  libiconv                                 yes
  ifnames                                  yes
  py_gzip                                  yes
  bin_pkg_config                           yes
  bin_xgettext                             yes
  bin_msgmerge                             yes
  bin_gzip                                 yes
  bin_bzip2                                yes
  ssl                                      yes
  linuxdvbapi                              yes
  inotify_h                                yes
  inotify_init1                            yes
  epoll_create1                            yes
  mpegts                                   yes
  mpegts_dvb                               yes

Packages:
  openssl                                  1.0.2n
  zlib                                     1.2.11

Installation paths:
  Prefix:                                  /opt
  Binaries:                                /opt/bin
  Libraries:                               ${prefix}/lib
  Data files:                              /opt/share
  Man pages:                               /opt/man

Adapter/tuner chipset or make/model?

Not available on my router.

Detailed description of problem. If possible: Steps to duplicate.

I'm running a proxy server that streams mpeg-ts.

With tvheadend, it works properly except one thing.

When my server responds 404 or 500 error to scan subscription request,
tvheadend generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router.
It doesn't occur on tvheadend 4.2.8 on Debian GNU/Linux(Windows Subsystem for Linux).

I tried 4.2.3, 4.2.7, 4.2.8 but there is no difference.

I'm running tvheadend with below options :

tvheadend -C -S -u admin -g root -p /opt/var/run/tvheadend.pid -l /opt/var/log/tvheadend.log -c /opt/apps/tvheadend

This is my mux URL :

pipe:///opt/bin/ffmpeg -loglevel fatal -i http://USERID:PASSWORD@localhost:8000/stream/streamer/123 -c copy -f mpegts pipe:1

This is ffmpeg execution result in shell on RT-AC68U router :

# /opt/bin/ffmpeg -i http://USERID:PASSWORD@localhost:8000/stream/streamer/123 -c copy -f mpegts pipe:1
ffmpeg version 3.2.12 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (OpenWrt GCC 7.3.0 r689-a82f5ad)
  configuration: --enable-cross-compile --cross-prefix=arm-openwrt-linux-gnueabi- --arch=arm --cpu=cortex-a9 --target-os=linux --prefix=/opt --pkg-config=pkg-config --enable-shared --enable-static --enable-pthreads --enable-zlib --disable-doc --disable-debug --disable-lzma --disable-vaapi --disable-vdpau --disable-outdevs --disable-altivec --disable-vsx --disable-power8 --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-inline-asm --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-mmi --disable-fast-unaligned --disable-runtime-cpudetect --enable-lto --disable-vfp --disable-neon --enable-avresample --enable-libopus --enable-small --enable-libshine --enable-gpl --enable-libx264
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[http @ 0x4c910] HTTP error 404 NOT FOUND
http://USERID:PASSWORD@localhost:8000/stream/streamer/123: Server returned 404 Not Found

This is response header of my server on Chrome :

HTTP/1.1 404 NOT FOUND
Server: gunicorn/19.9.0
Date: Sun, 14 Apr 2019 06:52:06 GMT
Connection: keep-alive
Content-Type: text/html; charset=utf-8
Content-Length: 44

And this is tvheadend logs :

2019-04-14 15:16:31.371 [  DEBUG]:mpegts: adding mux My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider to scan queue weight 6 flags 4000
2019-04-14 15:16:31.371 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - add raw service
2019-04-14 15:16:31.371 [  DEBUG]:service: 1: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider si 0x2a8a5b88 <unknown> weight 0 prio 11 error 0 (OK)
2019-04-14 15:16:31.371 [   INFO]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - tuning on IPTV
2019-04-14 15:16:31.377 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:31.377 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID 0000 (0) [20/0x2a88a638]
2019-04-14 15:16:31.377 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID 0001 (1) [16/0x2a86d788]
2019-04-14 15:16:31.377 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID 0010 (16) [16/0x2a870878]
2019-04-14 15:16:31.378 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID 0011 (17) [20/0x2a871ca8]
2019-04-14 15:16:31.378 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID 0011 (17) [16/0x2a990000]
2019-04-14 15:16:31.378 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - started
2019-04-14 15:16:31.378 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - open PID tables subscription [0042/0x2a916d08]
2019-04-14 15:16:31.379 [   INFO]:subscription: 0002: "scan" subscribing to mux "My_Provider.m3u - MY_UNABLE_CHANNEL", weight: 6, adapter: "IPTV", network: "My_Provider", service: "Raw PID Subscription" 
2019-04-14 15:16:32.828 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:32.899 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:32.972 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.052 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.125 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.201 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.280 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.358 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.371 [  DEBUG]:service: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider: Status changed to [CA check]
2019-04-14 15:16:33.437 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.510 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.587 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.665 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.744 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.824 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.898 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:33.975 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.053 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.126 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.200 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.272 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.344 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.422 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.496 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.570 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.651 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.729 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.805 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.876 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:34.951 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.030 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.102 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.172 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.245 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.320 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.397 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.475 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.555 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.638 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.716 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.797 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.881 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:35.960 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.040 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.120 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.196 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.284 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.363 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.443 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.523 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.599 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.677 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.760 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.834 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.911 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:36.985 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.061 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.135 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.210 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.284 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.359 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.434 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.506 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.581 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.657 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.731 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.808 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.888 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:37.963 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.036 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.118 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.191 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.267 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.342 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.420 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.498 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.579 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.662 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.738 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.819 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.896 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:38.968 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.047 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.121 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.198 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.275 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.350 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.430 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.513 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.591 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.665 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.736 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.808 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.879 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:39.953 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.028 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.101 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.181 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.257 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.332 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.411 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.490 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.570 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.649 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.724 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.801 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.876 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:40.952 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.035 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.116 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.203 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.288 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.359 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.432 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.507 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.592 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.666 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.743 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.820 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.903 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:41.982 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.062 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.142 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.215 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.293 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.370 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.445 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.520 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.594 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.665 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.742 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.816 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.892 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:42.967 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.047 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.122 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.194 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.273 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.349 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.432 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.507 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.582 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.659 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.732 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.808 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.882 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:43.956 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.035 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.109 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.183 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.261 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.340 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.421 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.495 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.581 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.657 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.729 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.807 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.884 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:44.958 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.045 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.124 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.199 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.276 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.355 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.438 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.516 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.594 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.668 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.751 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.822 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.899 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:45.981 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.053 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.132 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.208 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.284 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.358 [   INFO]:spawn: Executing "/opt/bin/ffmpeg" 
2019-04-14 15:16:46.371 [  DEBUG]:service: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider: Status changed to [CA check] [Graceperiod expired] [Data timeout]
2019-04-14 15:16:46.371 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID 0011 (17) [20/0x2a871ca8]
2019-04-14 15:16:46.371 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID 0010 (16) [16/0x2a870878]
2019-04-14 15:16:46.371 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID 0001 (1) [16/0x2a86d788]
2019-04-14 15:16:46.371 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID 0000 (0) [20/0x2a88a638]
2019-04-14 15:16:46.372 [   INFO]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - scan no data, failed
2019-04-14 15:16:46.372 [   INFO]:subscription: 0002: "scan" unsubscribing
2019-04-14 15:16:46.372 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID tables subscription [0042/0x2a916d08]
2019-04-14 15:16:46.372 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - stopping mux
2019-04-14 15:16:46.372 [  DEBUG]:mpegts: My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider - close PID 0011 (17) [16/0x2a990000]
2019-04-14 15:16:46.372 [  DEBUG]:mpegts: removing mux My_Provider.m3u - MY_UNABLE_CHANNEL in My_Provider from scan queue


Replies (7)

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by saen acro over 5 years ago

Are you transcode externally?
It seems as xacell used without correct output network.

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by DS Kim over 5 years ago

saen acro wrote:

Are you transcode externally?
It seems as xacell used without correct output network.

Thank you for your reply.

I'm using ffmpeg pipe for mux input.

pipe:///opt/bin/ffmpeg -loglevel fatal -i http://USERID:PASSWORD@localhost:8000/stream/streamer/123 -c copy -f mpegts pipe:1

The streaming URL (served from my server) responds 500 then 404, and it's intended to do so.
The problem is that my server should handle too many requests in short time from tvheadend's scanning subscription.

When I tested same URL on tvheadend 4.2.8 on Debian GNU/Linux(Windows Subsystem for Linux), tvheadend failed to scan and gave up immediately(tried just 2 times).
I think that's normal and expected process.

These are logs from tvheadend 4.2.8 on Debian GNU/Linux(Windows Subsystem for Linux) :

2019-04-14 17:13:45.922 mpegts: TEST_CHANNEL in TEST_PROVIDER - tuning on IPTV
2019-04-14 17:13:45.945 subscription: 0003: "scan" subscribing to mux "TEST_CHANNEL", weight: 6, adapter: "IPTV", network: "TEST_PROVIDER", service: "Raw PID Subscription" 
2019-04-14 17:13:45.945 spawn: Executing "/usr/bin/ffmpeg" 
2019-04-14 17:13:47.372 spawn: ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
2019-04-14 17:13:47.372 spawn:   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
2019-04-14 17:13:47.372 spawn:   configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv 
2019-04-14 17:13:47.372 spawn:   libavutil      55. 34.101 / 55. 34.101
2019-04-14 17:13:47.372 spawn:   libavcodec     57. 64.101 / 57. 64.101
2019-04-14 17:13:47.372 spawn:   libavformat    57. 56.101 / 57. 56.101
2019-04-14 17:13:47.372 spawn:   libavdevice    57.  1.100 / 57.  1.100
2019-04-14 17:13:47.373 spawn:   libavfilter     6. 65.100 /  6. 65.100
2019-04-14 17:13:47.373 spawn:   libavresample   3.  1.  0 /  3.  1.  0
2019-04-14 17:13:47.373 spawn:   libswscale      4.  2.100 /  4.  2.100
2019-04-14 17:13:47.373 spawn:   libswresample   2.  3.100 /  2.  3.100
2019-04-14 17:13:47.373 spawn:   libpostproc    54.  1.100 / 54.  1.100
2019-04-14 17:13:47.946 spawn: [http @ 0x7fffe7c6a740] HTTP error 500 Internal Server Error
2019-04-14 17:13:47.946 spawn: http://USERID:PASSWORD@localhost:8000/stream/My_Provider/339: Server returned 5XX Server Error reply
2019-04-14 17:13:47.973 spawn: Executing "/usr/bin/ffmpeg" 
2019-04-14 17:13:48.196 spawn: ffmpeg version 3.2.12-1~deb9u1 Copyright (c) 2000-2018 the FFmpeg developers
2019-04-14 17:13:48.196 spawn:   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
2019-04-14 17:13:48.196 spawn:   configuration: --prefix=/usr --extra-version='1~deb9u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv 
2019-04-14 17:13:48.196 spawn:   libavutil      55. 34.101 / 55. 34.101
2019-04-14 17:13:48.196 spawn:   libavcodec     57. 64.101 / 57. 64.101
2019-04-14 17:13:48.196 spawn:   libavformat    57. 56.101 / 57. 56.101
2019-04-14 17:13:48.196 spawn:   libavdevice    57.  1.100 / 57.  1.100
2019-04-14 17:13:48.196 spawn:   libavfilter     6. 65.100 /  6. 65.100
2019-04-14 17:13:48.196 spawn:   libavresample   3.  1.  0 /  3.  1.  0
2019-04-14 17:13:48.196 spawn:   libswscale      4.  2.100 /  4.  2.100
2019-04-14 17:13:48.196 spawn:   libswresample   2.  3.100 /  2.  3.100
2019-04-14 17:13:48.196 spawn:   libpostproc    54.  1.100 / 54.  1.100
2019-04-14 17:13:48.254 spawn: [http @ 0x7fffb84ed740] HTTP error 404 NOT FOUND
2019-04-14 17:13:48.254 spawn: http://USERID:PASSWORD@localhost:8000/stream/My_Provider/339: Server returned 404 Not Found
2019-04-14 17:13:48.273 iptv: stdin pipe unexpectedly closed: No data

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by saen acro over 5 years ago

Your stream point to localhost aka 127.0.0.1, how it come there?

Describe more detailed where stream travels.

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by DS Kim over 5 years ago

saen acro wrote:

Your stream point to localhost aka 127.0.0.1, how it come there?

Describe more detailed where stream travels.

Sorry, I modified the URL for privacy.
I'm actually using TLD in the streaming URL like http://xxxx:[email protected]:8000/stream/My_Provider/339.

My proxy server and tvheadend is running on RT-AC68U router.
My Windows laptop(running tvheadend 4.2.8 on Debian GNU/Linux) is conneted to RT-AC68U.

And RT-AC68U is routing router.xxxxxx.ga to itself(localhost) by dnsmasq.

So tvheadend on RT-AC68U and tvheadend on Debian(WSL) can request the same streaming URL to the proxy server on RT-AC68U.

    proxy server(8000)           
           |
RT-AC68U(router.xxxxxx.ga) <-----------> Laptop(192.168.x.x)
           |                                     |
      tvheadend(9981)                      tvheadend(9981)

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by DS Kim over 5 years ago

saen acro wrote:

Why you need proxy in this case?

The proxy server is a web crawler.
It scrapes streaming URLs from various remote providers and each of them requires complicated conditions(e.g. login, cookies...).
So I decided to make a proxy server that could handle them programmatically.
Actually, it works!

RE: IPTV scan subscribing generates too many spawn: Executing "/opt/bin/ffmpeg" on RT-AC68U router. - Added by DS Kim over 5 years ago

I think I found a solution.

126 line @ src/input/mpegts/iptv/iptv_pipe.c - 4.2

if (mclk() < im->mm_iptv_respawn_last + sec2mono(2)) {
        tvherror(LS_IPTV, "stdin pipe unexpectedly closed: %s",
                 r < 0 ? strerror(errno) : "No data");
      } else {

As I understand it, 'mclk()' is now, and 'im->mm_iptv_respawn_last' is the last started time of a spawn thread. And it checks whether 2 seconds have passed after the last spawn started. If it takes more than 2 seconds to reach the if statement then a new thread starts, otherwise the while loop is broken.

In my case, the condition of the if statement always returned False. That's why too many spawns are generated until timeout.

I think it's because 'im->mm_iptv_respawn_last' is 'long int', but the others are 'long long int'.

I tried to log them with :

tvherror(LS_IPTV, "## mclk() : %lld", mclk());
tvherror(LS_IPTV, "## im->mm_iptv_respawn_last : %lld", (long long int)im->mm_iptv_respawn_last);
tvherror(LS_IPTV, "## sec2mono(2) : %lld", sec2mono(2));
tvherror(LS_IPTV, "## im->mm_iptv_respawn_last + sec2mono(2): %lld", im->mm_iptv_respawn_last + sec2mono(2));
tvherror(LS_IPTV, "## abs(mclk()), abs(im->mm_iptv_respawn_last), abs(sec2mono(2)) : %d, %d, %d", abs(mclk()), abs(im->mm_iptv_respawn_last), abs(sec2mono(2)));

And these are what I'm got :

2019-04-19 16:15:59.445 iptv: ## mclk() : 179301691855
2019-04-19 16:15:59.445 iptv: ## im->mm_iptv_respawn_last : -1087559463
2019-04-19 16:15:59.445 iptv: ## sec2mono(2) : 2000000
2019-04-19 16:15:59.445 iptv: ## im->mm_iptv_respawn_last + sec2mono(2): -1085559463
2019-04-19 16:15:59.445 iptv: ## abs(mclk()), abs(im->mm_iptv_respawn_last), abs(sec2mono(2)) : 1086934577, 1087559463, 2000000
......
2019-04-19 16:15:59.539 iptv: ## mclk() : 179301791965
2019-04-19 16:15:59.539 iptv: ## im->mm_iptv_respawn_last : -1086934577
2019-04-19 16:15:59.539 iptv: ## sec2mono(2) : 2000000
2019-04-19 16:15:59.539 iptv: ## im->mm_iptv_respawn_last + sec2mono(2): -1084934577
2019-04-19 16:15:59.539 iptv: ## abs(mclk()), abs(im->mm_iptv_respawn_last), abs(sec2mono(2)) : 1086834467, 1086934577, 2000000
......

I don't know what values returned on the other systems, the 'im->mm_iptv_respawn_last' returned a negative time value on my RT-AC68U so far. That made a comparison of 'a positive value < a negative value' in the if statement. Therefore, the condition of the if statement always returns False.

My solution is using absolute values of the times, since they are just needed to check duration of a thread but not correct date and time. I'm totally new in C programming for Linux. So this solution has a chance not to work properly.

--- a/src/input/mpegts/iptv/iptv_pipe.c
+++ b/src/input/mpegts/iptv/iptv_pipe.c
@@ -123,7 +123,7 @@ iptv_pipe_read ( iptv_mux_t *im )
       spawn_kill(pid, iptv_pipe_kill_sig(im), im->mm_iptv_kill_timeout);
       im->mm_iptv_fd = -1;
       im->im_data = NULL;
-      if (mclk() < im->mm_iptv_respawn_last + sec2mono(2)) {
+      if (abs(mclk()) < abs(im->mm_iptv_respawn_last + sec2mono(2))) {
         tvherror(LS_IPTV, "stdin pipe unexpectedly closed: %s",
                  r < 0 ? strerror(errno) : "No data");
       } else {
    (1-7/7)