JoJoBond / 3LAS

Low Latency Live Audio Streaming
GNU General Public License v2.0
93 stars 23 forks source link

No player shown, no sound (PCM) #18

Closed DaCHack closed 3 years ago

DaCHack commented 3 years ago

Hi there!

First of all: Great tool, this is really high value. Many thanks for this!

Seems like I am doing something wrong:

No audio playing, no player buttons shown. The console window does not give me any hint except for these messages for all the js files: The script from “http://[IP]:8888/script/3las.helpers.js” was loaded even though its MIME type (“application/octet-stream”) is not a valid JavaScript MIME type.

Not sure what I could be doing wrong. Is there any more information in some log files?

Many thanks!

JoJoBond commented 3 years ago

That banner shouldn't be visible. Make sure that the main.css is inside the style folder and that it is loaded properly.

Or to be more precise. Make sure that the whole content of example/client/ is inside your www-folder and make sure that they are accessible (check owner/group and permissions, use chown/chmod to make corrections).

DaCHack commented 3 years ago

Hi, thanks for the reply.

Your hint regarding proper loading directed the path forward: Nginx did not load the list of mime-types and thus the css files where not loaded by the browser receiving them as application/octet instead of text/css. This is fixed and I can see the player now.

Yet I do not hear the sound from the microphone connected to the server. Connection to the server can be established in the client. So expect everything is fine there. Looking for the issue on the server side, but I am failing at trying to save the audio stream from my webcam into a file using the same parameters you used for the server script to check whether there is anything coming in at the source:

sudo ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 -acodec pcm_s16le -ar 16000 -ac 1 -f s16le -fflags +nobuffer -packetsize 384 -flush_packets 1 test_pcm.avi The result is a file with a reasonable file size but it is not playable with VLC or any other player.

A simple ffmpeg -f alsa -i hw:1 -t 10 out.wav Gives me a working audio file with the expected sound put into the microphone. So microphone and ALSA are working as expected.

Using MP3 the server works and the audio can be played in the client: ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 \ -acodec libmp3lame -b:a 320k -ac 1 -reservoir 0 \ -f mp3 -write_xing 0 -id3v2_version 0 -fflags +nobuffer -flush_packets 1 - \ | node /home/administrator/3LAS/example/server/3las.stdinstreamer.js -port 9601 -type mpeg Yet the load is slightly higher, because ffmpeg needs to do the conversion from the pcm raw stream from the webcam to mp3.

Please find the output of the original server script below. Any idea how to detect the error? sudo ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 -acodec pcm_s16le -ar 16000 -ac 1 -f s16le -fflags +nobuffer -packetsize 384 -flush_packets 1 - | node /home/administrator/3LAS/example/server/3las.stdinstreamer.js -port 9603 -type pcm -chunksize 384 ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Raspbian 8.3.0-6+rpi1) configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm WARNING: library configuration mismatch avutil configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs avcodec configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs avformat configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs avdevice configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs avfilter configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs avresample configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs swscale configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs swresample configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs postproc configuration: --prefix=/usr --extra-version='1~deb10u1+rpt1' --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --libdir=/usr/lib/arm-linux-gnueabihf/neon/vfp --cpu=cortex-a7 --arch=armv6t2 --disable-thumb --enable-shared --disable-doc --disable-programs libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, alsa, from 'hw:1': Duration: N/A, start: 1622373715.157157, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, s16le, to 'pipe:': Metadata: encoder : Lavf58.20.100 Stream #0:0: Audio: pcm_s16le, 16000 Hz, mono, s16, 256 kb/s Metadata: encoder : Lavc58.35.100 pcm_s16le size= 2877kB time=00:01:32.07 bitrate= 256.0kbits/s speed= 1x

JoJoBond commented 3 years ago

Have you tried using the WAVE sample? The PCM sample is finicky to set up correctly. I would highly recommend using WAVE, if there isn't a good reason not to. There should be next to no difference in processor load between PCM and WAVE. Make sure to enable/disable to right formats within the index.html.

DaCHack commented 3 years ago

With WAVE the client remains silent similar to the PCM sample:

`` [14:55:59] Detected: Linux, Firefox

[14:55:59] Using MIME: audio/wav on port: 9602

[14:55:59] Init of LiveAudioPlayer succeeded

[14:55:59] Init of AudioFormatReader succeeded

[14:56:02] Init of WebSocketClient succeeded

[14:56:02] Trying to connect to server.

[14:56:02] Established connection with server.

``

Connection is established. But no sound.

EDIT: I just tried with Chromium instead of Firefox and there it works with WAV.

JoJoBond commented 3 years ago

Ok, that's weird. Can you try using a generator as input? E.g. -re -f lavfi -i "aevalsrc='sin(1000*t*2*PI*t)':s=48000:d=3600" This way we eliminate the input as possible cause of the problem.

JoJoBond commented 3 years ago

Oh, I just saw your edit. I will check if WAVE works on my machine with Firefox.

JoJoBond commented 3 years ago

Did you make changes to the index.html before trying Chrome? It could be a cache problem with Firefox. I just tested it with FF 88 and it worked fine.

DaCHack commented 3 years ago

Many thanks. The issue is that this is supposed to work on iPhones' Safari as well in order to build a browser based babyphone. I am combining 3LAS with MJPG-Streamer using this start-up script:

#!/bin/sh

#Nginx running at start-up

#Push webcam audio to nginx
# https://github.com/JoJoBond/3LAS

#WAV
ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 \
-acodec pcm_s16le -ar 16000 -ac 1 \
-f wav -fflags +nobuffer -packetsize 384 -flush_packets 1 - \
| node /home/administrator/3LAS/example/server/3las.stdinstreamer.js -port 9602 -type wav -chunksize 384 &

#MP3
#ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 \
#-acodec libmp3lame -b:a 320k -ac 1 -reservoir 0 \
#-f mp3 -write_xing 0 -id3v2_version 0 -fflags +nobuffer -flush_packets 1 - \
#| node /home/administrator/3LAS/example/server/3las.stdinstreamer.js -port 9601 -type mpeg &

#Push webcam video to browser
#https://raubal-it.com/index.php/2020/11/27/raspberry-pi-raspi-als-webcam-nutzen/
export LD_LIBRARY_PATH=/home/administrator/mjpg-streamer/mjpg-streamer-experimental
/home/administrator/mjpg-streamer/mjpg-streamer-experimental/mjpg_streamer -o "output_http.so -p 80 -w /home/administrator/mjpg-streamer/mjpg-streamer-experimental/www" -i "input_uvc.so -r 1920x1080 -f 30"

With MP3 there seems to be an issue the one or the other time when load increases due to movement plus noise in from of the webcam. Hope that I can reduce this with WAV or PCM since this would only be routing input to output more or less :)

JoJoBond commented 3 years ago

It should work on mobile devices. That's pretty much what I intended it for. I'm not sure why Firefox gave you problems, but it does work on my machine. I don't know if you can open ALSA devices in two applications at the same time, there could be a problem there, I'm not sure though. The rest of the setup looks alright.

DaCHack commented 3 years ago

Well on Chromium it works fine for now. The MJPG-Streamer does not use the ALSA device AFAIK since it is only forwarding the MJPG-stream coming directly from the webcam.

I just tested the setup with a Raspberry Pi Zero and see that while the video is still no problem, the ffmpeg process from 3LAS takes >50% of the CPU, plus >30% for the node-process. That means 100% CPU utilization and video is delayed by 1-2 seconds more while the player drops all audio due to delays. Seems like I will need to stick to the Raspberry 3A with its 4 cores. But just for the audio streaming? hmmm

Let me fiddle around a bit on the RPi3 and report back. Does it work for you on iOS Safari?

JoJoBond commented 3 years ago

Yes it should work with iOS Safari.

DaCHack commented 3 years ago

9 was the issue. So the error was definitely on user side :)

Still I sometimes have the issue on iOS that neither the MJPG image loads nor the 3LAS controls are clickable. Instead the page seems to keep loading forever while only the black screen with the play-button and the "show/hide event log" box are visible. This happens if I visit the page once and then close the Safari app and return a little later. Seems like some connection is still open and blocks the reconnect.

EDIT: While this issue arises on iOS I can still access both video and audio incl all controls via Firefox or Chromium on my PC. So the issue is not on the server-side, but somewhere on the iPhone. Does this have something to do with #16 ? I see this issue is already quite old but sounds similar.

EDIT2: After a short while I loose audio connection in Chromium as well. Giving me the following output:

[14:50:10] Detected: Linux, Chrome
[14:50:10] Using MIME: audio/mpeg on port: 9601
[14:50:10] Init of LiveAudioPlayer succeeded
[14:50:10] Init of AudioFormatReader succeeded
[14:50:14] Init of WebSocketClient succeeded
[14:50:14] Trying to connect to server.
[14:50:14] Established connection with server.
[14:50:48] Reader error: Decoding failed.
[14:50:48] Reader error: Decoding failed.
[14:50:52] Reader error: Decoding failed.
[14:50:54] Reader error: Decoding failed.
[14:50:54] Reader error: Decoding failed.

Any idea how to solve this?

Thanks!

JoJoBond commented 3 years ago

You could try to raise the value for 'settings["mpeg"]["MinDecodeFrames"]' in 3las.formatreader.ts/js to something greater than 3.

DaCHack commented 3 years ago

I tried this but with limited effect. Will have a look over time but so far I did not see any change. But what I noticed looking into htop is that all applications seem to spawn additional processes. Is that normal? Or are those instances blocking each other?

(https://ibb.co/4gmGsZ5)

Second question: Do the map-files also need to be loaded by the browser? I get "Failed to load" messages with regard to them since I shifted from providing the www-resources from mjpeg-streamer directly instead of nginx.

JoJoBond commented 3 years ago

There should be one instance of ffmpeg and one instance of nodejs for each transmission. I don't spawn any additional instances within the server side script. All data goes via stdout/stdin and websockets. The map files are only for debugging, you don't have to serve them.

DaCHack commented 3 years ago

Hi @JoJoBond , after a while I seem to have solved the issue. I think it was the mjpg-streamer image that I loaded via an internal domain name into the HTML-Page. The domain resolution obviously did not work fast enough or cause issues particularly with the iOS DNS cache. Replacing

<img src="http://DOMAIN.DO:80/?action=stream" with <img src="http://IP:80/?action=stream"

did the job. I will watch it for a while but the last hour all went fine. Thanks for you patience. Let me give this a couple of days and then I will close this issue.

Opening up another one for an unrelated question.