问:
Raspberry Pi Youtube Livestream - ffmpeg error: av_interleaved_write_frame(): Broken pipe
I'm using a Raspberry Pi 3B (OS: Raspian) to livestream an attached camera feed to YouTube using the following command in a python script(I removed the livestream secret key):

raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -thread_queue_size 1024 -i /dev/zero -f h264 -thread_queue_size 1024 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/[My Secret Key]> /home/Desktop/Livestream_Logs/Output_Runthrough.txt 2>&1

However, I am running into a problem where the livestream cuts out at random times (usually after an hour) and the command terminates due to the following error: av_interleaved_write_frame(): Broken pipe

I am new to the ffmpeg command and live-streaming in general, so please go easy on me for I do not know what I am doing wrong with this command, nor do I understand all its arguments! This is a Christmas project I am working on, and I copied this command from this site.

Below is the output log from running the command. There were over 60,000 frames in the log so I removed most lines to save space, but included some samples; the bitrate and speed remained relatively the same throughout the command's execution:

```<code>ffmpeg version 4.3.5-0+deb11u1+rpt2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 10 (Raspbian 10.2.1-6+rpi1)
  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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. 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
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Input #1, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Stream mapping:
  Stream #1:0 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/[My Secret Key]':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1920x1080, q=2-31, 25 fps, 25 tbr, 1k tbn, 1200k tbc
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.91.100 aac
[flv @ 0x17f25a0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=   13 fps=0.0 q=-1.0 size=     196kB time=00:00:00.48 bitrate=3338.1kbits/s speed=0.945x
frame=   25 fps= 25 q=-1.0 size=     598kB time=00:00:00.97 bitrate=5021.1kbits/s speed=0.958x
frame=   38 fps= 25 q=-1.0 size=     911kB time=00:00:01.48 bitrate=5023.5kbits/s speed=0.977x
frame=   51 fps= 25 q=-1.0 size=    1236kB time=00:00:02.00 bitrate=5060.4kbits/s speed=0.987x
frame=   63 fps= 25 q=-1.0 size=    1622kB time=00:00:02.50 bitrate=5299.4kbits/s speed=0.989x
frame=   76 fps= 25 q=-1.0 size=    1866kB time=00:00:03.00 bitrate=5093.2kbits/s speed=0.988x
frame=   89 fps= 25 q=-1.0 size=    2157kB time=00:00:03.52 bitrate=5017.7kbits/s speed=0.992x
frame=  101 fps= 25 q=-1.0 size=    2435kB time=00:00:04.01 bitrate=4965.0kbits/s speed=0.992x

frame= 2119 fps= 25 q=-1.0 size=   51856kB time=00:01:24.72 bitrate=5013.7kbits/s speed=   1x
frame= 2131 fps= 25 q=-1.0 size=   52156kB time=00:01:25.24 bitrate=5012.4kbits/s speed=   1x
frame= 2144 fps= 25 q=-1.0 size=   52465kB time=00:01:25.75 bitrate=5012.0kbits/s speed=   1x
frame= 2157 fps= 25 q=-1.0 size=   52757kB time=00:01:26.24 bitrate=5011.4kbits/s speed=   1x
frame= 2170 fps= 25 q=-1.0 size=   53104kB time=00:01:26.76 bitrate=5014.1kbits/s speed=   1x
frame= 2182 fps= 25 q=-1.0 size=   53390kB time=00:01:27.26 bitrate=5012.2kbits/s speed=   1x
frame= 2195 fps= 25 q=-1.0 size=   53711kB time=00:01:27.77 bitrate=5013.0kbits/s speed=   1x
frame= 2207 fps= 25 q=-1.0 size=   53997kB time=00:01:28.25 bitrate=5011.9kbits/s speed=0.999x
frame= 2220 fps= 25 q=-1.0 size=   54299kB time=00:01:28.77 bitrate=5010.9kbits/s speed=   1x
frame= 2232 fps= 25 q=-1.0 size=   54641kB time=00:01:29.28 bitrate=5013.6kbits/s speed=   1x
frame= 2245 fps= 25 q=-1.0 size=   54952kB time=00:01:29.79 bitrate=5013.5kbits/s speed=   1x

frame= 6384 fps= 25 q=-1.0 size=  156217kB time=00:04:15.32 bitrate=5012.1kbits/s speed=   1x

frame=63216 fps= 25 q=-1.0 size= 1547043kB time=00:42:08.63 bitrate=5012.0kbits/s speed=   1x
frame=63229 fps= 25 q=-1.0 size= 1547337kB time=00:42:09.12 bitrate=5011.9kbits/s speed=   1x
frame=63242 fps= 25 q=-1.0 size= 1547710kB time=00:42:09.64 bitrate=5012.1kbits/s speed=   1x
frame=63254 fps= 25 q=-1.0 size= 1547959kB time=00:42:10.13 bitrate=5011.9kbits/s speed=   1x
frame=63267 fps= 25 q=-1.0 size= 1548272kB time=00:42:10.65 bitrate=5011.9kbits/s speed=   1x
frame=63274 fps= 25 q=-1.0 size= 1548443kB time=00:42:10.92 bitrate=5011.9kbits/s speed=0.986x
av_interleaved_write_frame(): Broken pipe
[flv @ 0x17f25a0] Failed to update header with correct duration.
[flv @ 0x17f25a0] Failed to update header with correct filesize.
Error writing trailer of rtmp://a.rtmp.youtube.com/live2/[MY SECRET KEY]: Broken pipe
frame=63274 fps= 25 q=-1.0 Lsize= 1548443kB time=00:42:10.92 bitrate=5011.9kbits/s speed=0.986x
video:1544778kB audio:646kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.195331%
[aac @ 0x17ee650] Qavg: 65536.000
Conversion failed!

</code>```

As stated before the command I am using is from this site. However, they are using avconv instead of ffmpeg, but since avconv would not work on my raspberry pi, I switched out "avconv" for "ffmpeg" and kept all the same flags.

I also added in "-thread_queue_size 1024" before both "-i" flags. This was a solution that I found within this link, which detailed how to get rid of the following error, which I initially thought could be the culprit to my problem but wasn't:

[h264 @ 0x1308e30] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)

Body:
I'm using a Raspberry Pi 3B (OS: Raspian) to livestream an attached camera feed to YouTube using the following command in a python script(I removed the livestream secret key):

raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -thread_queue_size 1024 -i /dev/zero -f h264 -thread_queue_size 1024 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/[My Secret Key]> /home/Desktop/Livestream_Logs/Output_Runthrough.txt 2>&1

However, I am running into a problem where the livestream cuts out at random times (usually after an hour) and the command terminates due to the following error: av_interleaved_write_frame(): Broken pipe

I am new to the ffmpeg command and live-streaming in general, so please go easy on me for I do not know what I am doing wrong with this command, nor do I understand all its arguments! This is a Christmas project I am working on, and I copied this command from this site.

Below is the output log from running the command. There were over 60,000 frames in the log so I removed most lines to save space, but included some samples; the bitrate and speed remained relatively the same throughout the command's execution:

ffmpeg version 4.3.5-0+deb11u1+rpt2 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 10 (Raspbian 10.2.1-6+rpi1)
  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --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. 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
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, s16le, from '/dev/zero':
  Duration: N/A, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Input #1, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Stream mapping:
  Stream #1:0 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/[My Secret Key]':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1920x1080, q=2-31, 25 fps, 25 tbr, 1k tbn, 1200k tbc
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.91.100 aac
[flv @ 0x17f25a0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=   13 fps=0.0 q=-1.0 size=     196kB time=00:00:00.48 bitrate=3338.1kbits/s speed=0.945x
frame=   25 fps= 25 q=-1.0 size=     598kB time=00:00:00.97 bitrate=5021.1kbits/s speed=0.958x
frame=   38 fps= 25 q=-1.0 size=     911kB time=00:00:01.48 bitrate=5023.5kbits/s speed=0.977x
frame=   51 fps= 25 q=-1.0 size=    1236kB time=00:00:02.00 bitrate=5060.4kbits/s speed=0.987x
frame=   63 fps= 25 q=-1.0 size=    1622kB time=00:00:02.50 bitrate=5299.4kbits/s speed=0.989x
frame=   76 fps= 25 q=-1.0 size=    1866kB time=00:00:03.00 bitrate=5093.2kbits/s speed=0.988x
frame=   89 fps= 25 q=-1.0 size=    2157kB time=00:00:03.52 bitrate=5017.7kbits/s speed=0.992x
frame=  101 fps= 25 q=-1.0 size=    2435kB time=00:00:04.01 bitrate=4965.0kbits/s speed=0.992x

frame= 2119 fps= 25 q=-1.0 size=   51856kB time=00:01:24.72 bitrate=5013.7kbits/s speed=   1x
frame= 2131 fps= 25 q=-1.0 size=   52156kB time=00:01:25.24 bitrate=5012.4kbits/s speed=   1x
frame= 2144 fps= 25 q=-1.0 size=   52465kB time=00:01:25.75 bitrate=5012.0kbits/s speed=   1x
frame= 2157 fps= 25 q=-1.0 size=   52757kB time=00:01:26.24 bitrate=5011.4kbits/s speed=   1x
frame= 2170 fps= 25 q=-1.0 size=   53104kB time=00:01:26.76 bitrate=5014.1kbits/s speed=   1x
frame= 2182 fps= 25 q=-1.0 size=   53390kB time=00:01:27.26 bitrate=5012.2kbits/s speed=   1x
frame= 2195 fps= 25 q=-1.0 size=   53711kB time=00:01:27.77 bitrate=5013.0kbits/s speed=   1x
frame= 2207 fps= 25 q=-1.0 size=   53997kB time=00:01:28.25 bitrate=5011.9kbits/s speed=0.999x
frame= 2220 fps= 25 q=-1.0 size=   54299kB time=00:01:28.77 bitrate=5010.9kbits/s speed=   1x
frame= 2232 fps= 25 q=-1.0 size=   54641kB time=00:01:29.28 bitrate=5013.6kbits/s speed=   1x
frame= 2245 fps= 25 q=-1.0 size=   54952kB time=00:01:29.79 bitrate=5013.5kbits/s speed=   1x

frame= 6384 fps= 25 q=-1.0 size=  156217kB time=00:04:15.32 bitrate=5012.1kbits/s speed=   1x

frame=63216 fps= 25 q=-1.0 size= 1547043kB time=00:42:08.63 bitrate=5012.0kbits/s speed=   1x
frame=63229 fps= 25 q=-1.0 size= 1547337kB time=00:42:09.12 bitrate=5011.9kbits/s speed=   1x
frame=63242 fps= 25 q=-1.0 size= 1547710kB time=00:42:09.64 bitrate=5012.1kbits/s speed=   1x
frame=63254 fps= 25 q=-1.0 size= 1547959kB time=00:42:10.13 bitrate=5011.9kbits/s speed=   1x
frame=63267 fps= 25 q=-1.0 size= 1548272kB time=00:42:10.65 bitrate=5011.9kbits/s speed=   1x
frame=63274 fps= 25 q=-1.0 size= 1548443kB time=00:42:10.92 bitrate=5011.9kbits/s speed=0.986x
av_interleaved_write_frame(): Broken pipe
[flv @ 0x17f25a0] Failed to update header with correct duration.
[flv @ 0x17f25a0] Failed to update header with correct filesize.
Error writing trailer of rtmp://a.rtmp.youtube.com/live2/[MY SECRET KEY]: Broken pipe
frame=63274 fps= 25 q=-1.0 Lsize= 1548443kB time=00:42:10.92 bitrate=5011.9kbits/s speed=0.986x
video:1544778kB audio:646kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.195331%
[aac @ 0x17ee650] Qavg: 65536.000
Conversion failed!

As stated before the command I am using is from this site. However, they are using avconv instead of ffmpeg, but since avconv would not work on my raspberry pi, I switched out "avconv" for "ffmpeg" and kept all the same flags.

I also added in "-thread_queue_size 1024" before both "-i" flags. This was a solution that I found within this link, which detailed how to get rid of the following error, which I initially thought could be the culprit to my problem but wasn't:

[h264 @ 0x1308e30] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)


来源: stackexchange

问:
How can I parse a javascript stack trace into the original stack trace after the fact?
We have a javascript application in production. We do not deploy mapping files. When we get an exception that we didn't expect (that's why they are called exceptions), we are left with a stack trace against our minified code, something like:

Error from the UI: https://www.my-site.com/ "mn@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:126651
1249/Ru/i<@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:463723
Ru@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:467475
Ji@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2014633
Ua@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2023533
Cs@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2062099
vu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2053592
mu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2053515
su@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2050524
Xo/<@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001895
t.unstable_runWithPriority@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2077296
Ko@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001604
Xo@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001842
Qo@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001775
nu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2047306
ba@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2019008
"
 Extra Details: https://www.my-site.com/ {"componentStack":"
    in t
    in N
    in L
    in Suspense
    in n
    in Unknown
    in c
    in t
    in Unknown
    in sb
    in t
    in n"}
```

I am assuming there must be a utility that I can use where I can plug in that stack trace, pass it a pointer to the mapping files and get a human-readable version of that stack trace. I have looked around and found paid, hosted solutions that do something similar. Or more manual ones (where I would have to punch in every line:column combination), and I swear I saw a Node utility at some point, but I cannot find it anymore...

Is there such a utility?

ContentLicense: CC BY-SA 4.0

Body:
We have a javascript application in production. We do not deploy mapping files. When we get an exception that we didn't expect (that's why they are called exceptions), we are left with a stack trace against our minified code, something like:

Error from the UI: https://www.my-site.com/ "mn@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:126651
1249/Ru/i<@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:463723
Ru@https://www.my-site.com/static/js/main.f2912b75.chunk.js:1:467475
Ji@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2014633
Ua@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2023533
Cs@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2062099
vu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2053592
mu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2053515
su@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2050524
Xo/<@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001895
t.unstable_runWithPriority@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2077296
Ko@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001604
Xo@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001842
Qo@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2001775
nu@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2047306
ba@https://www.my-site.com/static/js/2.fad31a53.chunk.js:2:2019008
"
 Extra Details: https://www.my-site.com/ {"componentStack":"
    in t
    in N
    in L
    in Suspense
    in n
    in Unknown
    in c
    in t
    in Unknown
    in sb
    in t
    in n"}

I am assuming there must be a utility that I can use where I can plug in that stack trace, pass it a pointer to the mapping files and get a human-readable version of that stack trace. I have looked around and found paid, hosted solutions that do something similar. Or more manual ones (where I would have to punch in every line:column combination), and I swear I saw a Node utility at some point, but I cannot find it anymore...

Is there such a utility?


问:
Conditional rows and/or columns using css (flex, grid)
In my project I have section in form, that can have several fields depending on request result from api. It can display from 1 to 4 fields. According to design system, if there are up to 3 fields, they should be displayed in exactly 1 row, but if there are 4 fields, they should be placed in 2 rows (2 fields per row). I'm wondering if there a smart way without using javascript, to place them in compliance with design system.

https://i.stack.imgur.com/xQ1Gr.png
https://i.stack.imgur.com/tRj7i.png

I've search uncle google and I found few examples of auto placement with css grid, but all of them are placing items in fixed row size which is not that I'm looking for


问:
How to upload image from input type with axios to mongodb?
I failed to save image in input fontend to mongdb, please help me to fix it. I tried to learn without being very good at it.
There might be some code error, please fix it for me.

My code

form

```<code>    return (
                        <div className="form-group">
                            <label>อัพโหลดรูปภาพ</label>
                            <div className="input-group mb-3">
                                <input type="file"
                                    className="form-control"
                                    id="img"
                                    accept="image/*"
                                    name="img"
                                    onChange={submitImg}
                                />
                            </div>
                    <input type="submit" value="ส่งข้อมูล" className="btn btn-primary" />

    )
}

export default FormComponent;
</code>```

mongoose

```<code>const mongoose = require("mongoose")
const blogSchema = mongoose.Schema({
    title:{
        type:String,
        required:true
    },
    content:{
        type:{},
        required:true
    },
    author:{
        type:String,
        default:"Admin"
    },
    img:{
        data:Buffer,
        contentType:String
    },
    slug:{
        type:String,
        unique:true
    }

},{timestamps:true})

module.exports = mongoose.model("Blogs",blogSchema)
</code>```

router

```<code>router.post('/create',upload.single('img'),create)
</code>```

Save

```<code>exports.create = async (req, res) => {
    let slug = uuidv4();
    let saveBlog = new Blogs({
        title: req.body.title,
        content: req.body.content,
        author: req.body.author,
        img: {
            data: fs.readFileSync("uploads/"+req.file.filename),
            contentType: 'image/png' || 'image/jpg'
        },
        slug: slug
    })

    saveBlog
        .save()
        .then(() => {
            console.log("Saved successfully!");
            res.status(200).json({ 'blog': 'blog saved successfully' });
        })
        .catch(err => {
            console.log("blog save unsuccessful!");
            res.status(400).send('adding new blog failed');
        });
}
</code>```

Image does not save

I want to save multiple data Both the text and pictures

Body:
I failed to save image in input fontend to mongdb, please help me to fix it. I tried to learn without being very good at it.
There might be some code error, please fix it for me.

My code

form

    return (

                            อัพโหลดรูปภาพ

                                <input type="file"
                                    className="form-control"
                                    id="img"
                                    accept="image/*"
                                    name="img"
                                    onChange={submitImg}
                                />

                    <input type="submit" value="ส่งข้อมูล" className="btn btn-primary" />

    )
}

export default FormComponent;

mongoose

const mongoose = require("mongoose")
const blogSchema = mongoose.Schema({
    title:{
        type:String,
        required:true
    },
    content:{
        type:{},
        required:true
    },
    author:{
        type:String,
        default:"Admin"
    },
    img:{
        data:Buffer,
        contentType:String
    },
    slug:{
        type:String,
        unique:true
    }

},{timestamps:true})

module.exports = mongoose.model("Blogs",blogSchema)

router

router.post('/create',upload.single('img'),create)

Save

exports.create = async (req, res) => {
    let slug = uuidv4();
    let saveBlog = new Blogs({
        title: req.body.title,
        content: req.body.content,
        author: req.body.author,
        img: {
            data: fs.readFileSync("uploads/"+req.file.filename),
            contentType: 'image/png' || 'image/jpg'
        },
        slug: slug
    })

    saveBlog
        .save()
        .then(() => {
            console.log("Saved successfully!");
            res.status(200).json({ 'blog': 'blog saved successfully' });
        })
        .catch(err => {
            console.log("blog save unsuccessful!");
            res.status(400).send('adding new blog failed');
        });
}

Image does not save

I want to save multiple data Both the text and pictures


问:
Tensorflow giving a ValueError: No gradients provided for any variable
I'm trying to implement a loss function that increases loss as the model ranks images from worst to best, to do this I've come up with an algorithm that sorts the predicted score array according to the true scores of the image batch, then starting from the largest predicted score, check how far away it is from the first position in the array and give it a loss based on that, for the second largest we will see how far away it is from the 2nd array position and give it a loss based on that

To do this, I'm using tf.nn.top_k and other functions that I looked up to all be differentiable to my knowledge, but I still get the No gradients provided error

Can someone please tell me what part am I doing wrong?

Please note that the global sub_tensor was a workaround (to replace correct_indices) I was doing to avoid using a range which I know is non-differentiable, an array from outside the function that is fixed to be a range of the length of the batch [0-32]. This still didn't work

```<code>sub_tensor = constant(np.array([np.arange(32)],dtype='int32'))

def get_ranking_loss(y_true,y_pred):
    global sub_tensor
    _, y_true_ind_k = tf.nn.top_k(y_true, y_true.shape[1])

    sorted_y_pred = tf.gather(y_pred,y_true_ind_k)

    _, y_pred_ind_k = tf.nn.top_k(sorted_y_pred, sorted_y_pred.shape[1])

    # correct_indices = tf.range(0,sorted_y_pred.shape[1])
    subtracted = tf.math.subtract(y_pred_ind_k,sub_tensor)
    absolute = tf.abs(subtracted)
    absolute = tf.cast(absolute, float64)
    return tf.reduce_sum(absolute)
</code>```

I tried to change almost all functions to be tf functions only, but no luck

Body:
I'm trying to implement a loss function that increases loss as the model ranks images from worst to best, to do this I've come up with an algorithm that sorts the predicted score array according to the true scores of the image batch, then starting from the largest predicted score, check how far away it is from the first position in the array and give it a loss based on that, for the second largest we will see how far away it is from the 2nd array position and give it a loss based on that

To do this, I'm using tf.nn.top_k and other functions that I looked up to all be differentiable to my knowledge, but I still get the No gradients provided error

Can someone please tell me what part am I doing wrong?

Please note that the global sub_tensor was a workaround (to replace correct_indices) I was doing to avoid using a range which I know is non-differentiable, an array from outside the function that is fixed to be a range of the length of the batch [0-32]. This still didn't work

sub_tensor = constant(np.array([np.arange(32)],dtype='int32'))

def get_ranking_loss(y_true,y_pred):
    global sub_tensor
    _, y_true_ind_k = tf.nn.top_k(y_true, y_true.shape[1])

    sorted_y_pred = tf.gather(y_pred,y_true_ind_k)

    _, y_pred_ind_k = tf.nn.top_k(sorted_y_pred, sorted_y_pred.shape[1])

    # correct_indices = tf.range(0,sorted_y_pred.shape[1])
    subtracted = tf.math.subtract(y_pred_ind_k,sub_tensor)
    absolute = tf.abs(subtracted)
    absolute = tf.cast(absolute, float64)
    return tf.reduce_sum(absolute)

I tried to change almost all functions to be tf functions only, but no luck


问:
Valgrind massif maximum mmap size
When I use mmaping for a large file(80-150 GB) valgrind failed with the error (mmap): Invalid argument, intuitively, I realized that the problem was probably with the file size, I tried to reduce the file size by half and it worked.
The question is, how to make mmaping in Valgrind "unlimited"?

Some details:

```<code>System details:    ubuntu 20.04, x86, valgrind 3.21, 8 GB RAM, 2 CPU
Command:           valgrind --tool=massif --pages-as-heap=yes ./app
mmap call:         ptr = mmap(nullptr, len, PROT_READ, MAP_SHARED, fd, 0);
working mmap call: ptr = mmap(nullptr, len/2, PROT_READ, MAP_SHARED, fd, 0);
</code>```

Title: Valgrind massif maximum mmap size

Body:
When I use mmaping for a large file(80-150 GB) valgrind failed with the error (mmap): Invalid argument, intuitively, I realized that the problem was probably with the file size, I tried to reduce the file size by half and it worked.
The question is, how to make mmaping in Valgrind "unlimited"?

Some details:

System details:    ubuntu 20.04, x86, valgrind 3.21, 8 GB RAM, 2 CPU
Command:           valgrind --tool=massif --pages-as-heap=yes ./app
mmap call:         ptr = mmap(nullptr, len, PROT_READ, MAP_SHARED, fd, 0);
working mmap call: ptr = mmap(nullptr, len/2, PROT_READ, MAP_SHARED, fd, 0);


问:
How to find out from a Java class method whether there is an object of another, given, Java class?
Good day!
I have an Apache Netbeans module with several Java classes in it. I'd like to find out when executing a method belonging to an object of, say, class A if another class (class B) had already been instantiated and in this case discover what is this object so that I can call one of its methods from the class A object method. So I am not trying to find out the class of a given object, I am trying to find if there is an object of a given class.
Any ideas?
Thanks! Erminio.

I didn't try any code because I really have no idea where to start.


问:
How to display multiple CSV files as separate tables using javascript?
I am currently using the script below to display CSV data in a HTML table.

function createDataElement(htmlTag, innerText, idParent) {
  let node = document.createElement(htmlTag);
  let textnode = document.createTextNode(innerText);
  node.appendChild(textnode);
  document.getElementById(idParent).appendChild(node);
}

function createHeaderElement(columnText) {
  createDataElement("th", columnText, "tableHeader");
}

function createCellData(rowIndex, dataIndex, cellText) {
  if (dataIndex === 0) {
    let node = document.createElement("tr");
    node.setAttribute("id", "row" + rowIndex);
    document.getElementById("tableBody").appendChild(node);

    createDataElement("td", cellText, "row" + rowIndex);
  } else {
    createDataElement("td", cellText, "row" + rowIndex);
  }
}

var csv_url = 'https://www.sample-videos.com/csv/Sample-Spreadsheet-10-rows.csv';

Papa.parse(csv_url, {
  download: true,
  complete: function(results) {
    for (let i = 0; i < results.data.length; i++) {
      if (i === 0) {
        for (let j = 0; j < results.data[i].length; j++) {
          createHeaderElement(results.data[i][j]);
        }
      }
      if (i > 0) {
        for (let j = 0; j < results.data[i].length; j++) {
          createCellData(i, j, results.data[i][j]);
        }
      }
    }
  }
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.1/papaparse.min.js"
        integrity="sha512-EbdJQSugx0nVWrtyK3JdQQ/03mS3Q1UiAhRtErbwl1YL/+e2hZdlIcSURxxh7WXHTzn83sjlh2rysACoJGfb6g=="
        crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<table style="width: 90vw; margin: auto;" class="table table-sm table-striped">
  <thead>
    <tr id="tableHeader">
    </tr>
  </thead>
  <tbody id="tableBody">
  </tbody>
</table></code>```

However, this only works for one HTML table. I have tried adding unique classes to the table but it will still only show one.

How do I adapt this code to show multiple tables from seperate CSV files?

 and
 are required as I am styling with Bootstrap.

Cannot loop through the different CSV files as there is content between each table, so need to be able to position the HTML tables separately.

Need to be able to add a unique class to the
 for additional styling.

Body:
I am currently using the script below to display CSV data in a HTML table.

function createDataElement(htmlTag, innerText, idParent) {
  let node = document.createElement(htmlTag);
  let textnode = document.createTextNode(innerText);
  node.appendChild(textnode);
  document.getElementById(idParent).appendChild(node);
}

function createHeaderElement(columnText) {
  createDataElement("th", columnText, "tableHeader");
}

function createCellData(rowIndex, dataIndex, cellText) {
  if (dataIndex === 0) {
    let node = document.createElement("tr");
    node.setAttribute("id", "row" + rowIndex);
    document.getElementById("tableBody").appendChild(node);

    createDataElement("td", cellText, "row" + rowIndex);
  } else {
    createDataElement("td", cellText, "row" + rowIndex);
  }
}

var csv_url = 'https://www.sample-videos.com/csv/Sample-Spreadsheet-10-rows.csv';

Papa.parse(csv_url, {
  download: true,
  complete: function(results) {
    for (let i = 0; i < results.data.length; i++) {
      if (i === 0) {
        for (let j = 0; j < results.data[i].length; j++) {
          createHeaderElement(results.data[i][j]);
        }
      }
      if (i > 0) {
        for (let j = 0; j < results.data[i].length; j++) {
          createCellData(i, j, results.data[i][j]);
        }
      }
    }
  }
});

However, this only works for one HTML table. I have tried adding unique classes to the table but it will still only show one.

How do I adapt this code to show multiple tables from seperate CSV files?

 and
 are required as I am styling with Bootstrap.

Cannot loop through the different CSV files as there is content between each table, so need to be able to position the HTML tables separately.

Need to be able to add a unique class to the
 for additional styling.


问:
Web scraper not getting data from table (Java) using Jsoup
I am working on a web scraper to gather stats from https://www.nba.com for a project, but my scraper is somehow not gathering data from the table, as the table says it has size 0 (makes it seem like its not getting the table at all).

Could someone let me know if I am doing something wrong and how to fix it?

I tried to gather from table tbody.Crom_body__UYOcU and to make sure it worked, I checked the size. Should've been much more than 0 (50 or 100 I do not remember) but returned just 0 from size().


问:
How i can make correct rounding down float number in python
I need to compare two float numbers up to 3 decimal places, everything after 3 decimal should be thrown out (do not participate in rounding).

In my function im subtract 0.0005 from each number and then round this numbers via np.around(diff_v, 3), then im check number difference by error value (0.000101)

In some cases it doesn't work the way i expect.

Example

coef = 3

value_error = 0.00101

v1 = 625.016
v2 = 625.015

v1r = 625.016 ( (625.016 - 0.0005) then np.around(625.0155, 3) )

v2r = 625.014 ( (625.015 - 0.0005) then np.around(625.0145, 3) )

v = 625.016 - 625.014 = 0.002 (but original numbers difference is 0.001)

How make this is correct?

My code:

```<code>def compare_values(v1, v2, coef):
    v1r = np.around(v1 - rv, coef)
    v2r = np.around(v2 - rv, coef)
    v = np.abs(v1r - v2r)
    return v <= value_error, v
</code>```

Body:
I need to compare two float numbers up to 3 decimal places, everything after 3 decimal should be thrown out (do not participate in rounding).

In my function im subtract 0.0005 from each number and then round this numbers via np.around(diff_v, 3), then im check number difference by error value (0.000101)

In some cases it doesn't work the way i expect.

Example

coef = 3

value_error = 0.00101

v1 = 625.016
v2 = 625.015

v1r = 625.016 ( (625.016 - 0.0005) then np.around(625.0155, 3) )

v2r = 625.014 ( (625.015 - 0.0005) then np.around(625.0145, 3) )

v = 625.016 - 625.014 = 0.002 (but original numbers difference is 0.001)

How make this is correct?

My code:

def compare_values(v1, v2, coef):
    v1r = np.around(v1 - rv, coef)
    v2r = np.around(v2 - rv, coef)
    v = np.abs(v1r - v2r)
    return v <= value_error, v


问:
Can you retrieve an event signal from a browsers automatic save password promt running
I am building a pyside6 password manager, I intend to give it an a rest api that takes a json payload of credentials from a request and add it to the local password manager.
Then I will create browser extensions for at least chrome, Firefox and safari that will be an event handler signaled by saving a password with the browsers default password prompt. My issue here is I can’t find a shred of information on how I might get a signal in JavaScript from that save password event. So how might I make the save password prompt act like an event or grab the event that calls the prompt itself?Any guidance or direction would be appreciated

I tried many different search patterns on Google and explored JavaScript api documentation as well as chrome browser extension documentation for an answer but no solution was found.


问:
Hangfire run twice in two high availability servers
I have hangfire recurring In two high availability servers and the problem is that every job get run twice, I want to prevent all job to be ran twice.
It’s implemented in ASP.NET CORE.

We need solution please to solve this problem


问:
Exclude dynamic Temporary drive from KQL query
I have a KQL query that queries the disk logs from Azure Log Insights.I can exclude specific drive names from the query but in my scenario the Azure VM is allocates Temporay storage based on the availability since we are migrating from a data center . So in this is D is already allocated E becomes the temporary storage. Please let me know if there is a way to catch this in the KQL and exclude from the log query mentioned below

```<code>InsightsMetrics
| where Name == "FreeSpaceMB"
| extend Tags = parse_json(Tags)
| extend mountId = tostring(Tags["vm.azm.ms/mountId"])
    , diskSizeMB = toreal(Tags["vm.azm.ms/diskSizeMB"])
| project-rename FreeSpaceMB = Val
| summarize arg_max(TimeGenerated, diskSizeMB, FreeSpaceMB)
    by Computer, mountId
    , FreeSpacePercentage = round(FreeSpaceMB / diskSizeMB * 100, 1)
| extend diskSizeGB = round(diskSizeMB / 1024, 1)
    , FreeSpaceGB = round(FreeSpaceMB / 1024, 1)
| project TimeGenerated, Computer, mountId, diskSizeGB, FreeSpaceGB, FreeSpacePercentage
| order by Computer asc, mountId asc
</code>```

Appreciate your help on this. Attaching the screenshot of the drive sample.

Body:
I have a KQL query that queries the disk logs from Azure Log Insights.I can exclude specific drive names from the query but in my scenario the Azure VM is allocates Temporay storage based on the availability since we are migrating from a data center . So in this is D is already allocated E becomes the temporary storage. Please let me know if there is a way to catch this in the KQL and exclude from the log query mentioned below

InsightsMetrics
| where Name == "FreeSpaceMB"
| extend Tags = parse_json(Tags)
| extend mountId = tostring(Tags["vm.azm.ms/mountId"])
    , diskSizeMB = toreal(Tags["vm.azm.ms/diskSizeMB"])
| project-rename FreeSpaceMB = Val
| summarize arg_max(TimeGenerated, diskSizeMB, FreeSpaceMB)
    by Computer, mountId
    , FreeSpacePercentage = round(FreeSpaceMB / diskSizeMB * 100, 1)
| extend diskSizeGB = round(diskSizeMB / 1024, 1)
    , FreeSpaceGB = round(FreeSpaceMB / 1024, 1)
| project TimeGenerated, Computer, mountId, diskSizeGB, FreeSpaceGB, FreeSpacePercentage
| order by Computer asc, mountId asc

Appreciate your help on this. Attaching the screenshot of the drive sample.


问:
How to listen to an unlock screen event on Android
I'm trying to get a function to trigger whenever the screen gets unlocked, even if the app is not running.

With Android <= 8 it was possible to use the Broadcast service and define the triggers in the manifest.xml like shown here

However, I could not find any information on how to listen to such events like screen unlocked (android.intent.action.USER_PRESENT) with the "new" Work Manager or any other way.


问:
how to find metrics on servers Like Azure Vms
how to find metrics on servers like Azure Vms, that would help me. Like metrics as in when people login, cpu usage, ram usage.

Datadog servers or Azure monitor thought would help me


问:
Screen become grey when i navigate to her again
Im building a React Native app using react-native-maps.

I made all the screens, which are two, the login and the main page that has a map, but every time I leave the main page and come back it turns gray, and it only comes back when I leave and go back to the app. if anyone can give me a solution why this happens.

The screen gray
How acctually is the screen

I finish the screen, but this is the only thing wrong.

The code of the page is:

```<code><>
  <Drawer
    type="overlay"
    content={<Sidemenu />}
    captureGestures={'open'}
    open={SidemenuVisible}
    onClose={() => setSidemenuVisible(false)}
    openDrawerOffset={0.27}
    panOpenMask={20}
    negotiatePan={false}
    panCloseMask={0.2}
    tapToClose={true}
    closedDrawerOffset={0}
    tweenHandler={(ratio) => ({ main: { opacity: (2 - ratio) / 2 } })}
  >
    <View style={styles.containerMap}>
      {
        ShowUpperButton ?
        <FAB
        icon="menu"
        style={styles.fab}
        onPress={() => setSidemenuVisible(true)}
        mode='flat'
        color='#fff'
        customSize={65}
      />
      :
      null
      }
        <MapView
          provider='google'
          ref={mapRef}
          style={styles.mapView}
          onMapReady={() => initInfo()}
          showsUserLocation={true}
          userLocationPriority="high"
          followsUserLocation={true}
          showsMyLocationButton={false}
          loadingIndicatorColor='#000'
          loadingEnabled={true}
          showsCompass={false}
          initialRegion={{
            latitude: LocationRef.current.latitude,
            longitude: LocationRef.current.longitude,
            latitudeDelta: 0,
            longitudeDelta: 0.02,
          }}
          customMapStyle={mapStyle}>
            {
              MarkersRef.current.map((marker,index) => {
                return (
                  <Marker
                  key={index}
                  coordinate={marker}
                  title={TitleMarkersRef.current[index]}
                  >
                    <Icons name='map-marker' color='#005042' size={25}/>
                  </Marker>
                )
              })
            }

            {
              (WaypointsToRouteRef.current.length > 2 ? (
                <Polyline
                coordinates={WaypointsToRouteRef.current}
                strokeWidth={4}
                strokeColor='#f2ae30'/>
              ): null)
            }
        </MapView>
      <LinearGradient start={{ x: 0, y: 0 }} end={{ x: 0.8, y: 0 }} colors={['#f2ae30', '#c8860d']} style={styles.containerBar}>
        <TouchableOpacity style={styles.viewFristButton} activeOpacity={1} onPress={() => {buttonMenuClicked()}}>
          <Material
            color="#fff"
            name="group"
            size={30}
          />
      </TouchableOpacity>
        <View style={styles.viewLine} />
        <TouchableOpacity style={styles.viewSecondButton} activeOpacity={1} onPress={() => {buttonMenuClicked()}}>
          <Text style={styles.secondButtonText}>{status}</Text>
          <Text style={styles.secondButtonHoursText}>
            {
            status === 'Aguardando Solicitação' || status === 'A Disposição' ? time : Distance
            }</Text>
        </TouchableOpacity>
        <View style={styles.viewLine} />
        <View style={styles.viewThirdButton}>
        <TouchableOpacity style={styles.viewThirdButton} onPress={() => {
          if(status === 'Aguardando Solicitação'){
            buttonMenuClicked();
          }
          else{
            menuRef.current?.show()
          }
          }} activeOpacity={0.8}>
          <Icons
            color="#fff"
            name="ellipsis-v"
            size={20}
          />
      </TouchableOpacity>
        </View>
        <Menu
        ref={menuRef}/>
      </LinearGradient>
    {
      BlurViewVisible ?
      <BlurView
      style={styles.absolute}
      blurType="dark"
      blurAmount={1}
      reducedTransparencyFallbackColor="black"
    /> : null
    }

    </View>
  </Drawer>
</>
</code>```

Body:
Im building a React Native app using react-native-maps.

I made all the screens, which are two, the login and the main page that has a map, but every time I leave the main page and come back it turns gray, and it only comes back when I leave and go back to the app. if anyone can give me a solution why this happens.

The screen gray
How acctually is the screen

I finish the screen, but this is the only thing wrong.

The code of the page is:

<>
  <Drawer
    type="overlay"
    content={<Sidemenu />}
    captureGestures={'open'}
    open={SidemenuVisible}
    onClose={() => setSidemenuVisible(false)}
    openDrawerOffset={0.27}
    panOpenMask={20}
    negotiatePan={false}
    panCloseMask={0.2}
    tapToClose={true}
    closedDrawerOffset={0}
    tweenHandler={(ratio) => ({ main: { opacity: (2 - ratio) / 2 } })}
  >
    <View style={styles.containerMap}>
      {
        ShowUpperButton ?
        <FAB
        icon="menu"
        style={styles.fab}
        onPress={() => setSidemenuVisible(true)}
        mode='flat'
        color='#fff'
        customSize={65}
      />
      :
      null
      }
        <MapView
          provider='google'
          ref={mapRef}
          style={styles.mapView}
          onMapReady={() => initInfo()}
          showsUserLocation={true}
          userLocationPriority="high"
          followsUserLocation={true}
          showsMyLocationButton={false}
          loadingIndicatorColor='#000'
          loadingEnabled={true}
          showsCompass={false}
          initialRegion={{
            latitude: LocationRef.current.latitude,
            longitude: LocationRef.current.longitude,
            latitudeDelta: 0,
            longitudeDelta: 0.02,
          }}
          customMapStyle={mapStyle}>
            {
              MarkersRef.current.map((marker,index) => {
                return (
                  <Marker
                  key={index}
                  coordinate={marker}
                  title={TitleMarkersRef.current[index]}
                  >
                    <Icons name='map-marker' color='#005042' size={25}/>
                  </Marker>
                )
              })
            }

            {
              (WaypointsToRouteRef.current.length > 2 ? (
                <Polyline
                coordinates={WaypointsToRouteRef.current}
                strokeWidth={4}
                strokeColor='#f2ae30'/>
              ): null)
            }
        </MapView>
      <LinearGradient start={{ x: 0, y: 0 }} end={{ x: 0.8, y: 0 }} colors={['#f2ae30', '#c8860d']} style={styles.containerBar}>
        <TouchableOpacity style={styles.viewFristButton} activeOpacity={1} onPress={() => {buttonMenuClicked()}}>
          <Material
            color="#fff"
            name="group"
            size={30}
          />
      </TouchableOpacity>
        <View style={styles.viewLine} />
        <TouchableOpacity style={styles.viewSecondButton} activeOpacity={1} onPress={() => {buttonMenuClicked()}}>
          <Text style={styles.secondButtonText}>{status}</Text>
          <Text style={styles.secondButtonHoursText}>
            {
            status === 'Aguardando Solicitação' || status === 'A Disposição' ? time : Distance
            }</Text>
        </TouchableOpacity>
        <View style={styles.viewLine} />
        <View style={styles.viewThirdButton}>
        <TouchableOpacity style={styles.viewThirdButton} onPress={() => {
          if(status === 'Aguardando Solicitação'){
            buttonMenuClicked();
          }
          else{
            menuRef.current?.show()
          }
          }} activeOpacity={0.8}>
          <Icons
            color="#fff"
            name="ellipsis-v"
            size={20}
          />
      </TouchableOpacity>
        </View>
        <Menu
        ref={menuRef}/>
      </LinearGradient>
    {
      BlurViewVisible ?
      <BlurView
      style={styles.absolute}
      blurType="dark"
      blurAmount={1}
      reducedTransparencyFallbackColor="black"
    /> : null
    }

    </View>
  </Drawer>
</>


问:
Playing one video while another is buffering
I have two videos. Video A is present on the device while video B needs to be streamed off the internet. My goal is to play video A while video B starts buffering. As I understand it I need to create one MediaPlayer instance for each video. Then I can call prepareAsync() on both and start playing in onPrepared(). However, there seem to be some limitations in Android which together prevent this from working properly:

1) MediaPlayer can only start buffering after it has been provided a SurfaceView which is present on screen.

2) Only one MediaPlayer at a time can be connected to a SurfaceView.

3) There is only support for a single SurfaceView on screen.

One one phone I have managed to get two MediaPlayer instances to share one SurfaceView. On another I can get two SurfaceViews on screen at the same time. But as I understand it neither is officially supported by Android?

Am I doing something wrong? Has anyone else got this working?

ContentLicense: CC BY-SA 3.0


问:
Apple Push Notifications arriving on MacOS, but not in the application itself
I'm running an iOS one-time password (OTP) application, and a corresponding MacOS companion app. In the iOS application, users are able to tap on one-time passwords, resulting in the iOS application sending an HTTP request to my server. My server in turn, will send a push notification to the MacOS application, containing the tapped one-time password. All encrypted of course, but that's irrelevant for the issue.

```<code>iOS application -> HTTP request -> My server -> APS -> MacOS application
</code>```

Recently, after users started upgrading to MacOS Ventura, the MacOS application stopped receiving notifications. I can see (and I've verified) that the process from the iOS application to the server, to APS works. APS returns a 200 OK success status, indicating that the push notification was sent to the MacOS device.

However, in my MacOS application the notification is not received in the didReceiveRemoteNotification function (which I included below).

```<code>/// Sent to the delegate when a running application receives a remote notification.
///
/// - Parameter application: The application that received the remote notification.
/// - Parameter userInfo: A dictionary that contains information related to the remote notification, specifically a badge number for the application icon, a notification identifier, and possibly custom data.
func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) {
    NotificationHelper.shared.notify(userInfo)

    log.verbose("Received a remote notification in the application delegate.")
}
</code>```

The didRegisterForRemoteNotificationsWithDeviceToken function does work, and I can see it succeeded because of my applications' debug logging.

```<code>/// Sent to the delegate when Apple Push Services successfully completes the registration process.
///
/// - Parameter application: The application that initiated the remote-notification registration process.
/// - Parameter deviceToken: A token that identifies the device to Apple Push Notification Service (APNS).
func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    settingsView.pushToken.data = deviceToken
    linkingView.pushToken.data = deviceToken

    log.verbose("Successfully completed APNS registration process.")
}
</code>```

I've verified that I'm using an actual production key for APS, and that the MacOS application itself is a production build as well (or well, TestFlight in my case). I used the same production key and build before users started upgrading to Ventura, and it always worked.

What's interesting is that, although I can't see anything in Xcode or in my debug logging of the production build of the app, the Console.app of MacOS does show the push notification being received. I've included some of the Console.app APS logging (from when a notification should be received in my MacOS application) below.

```<code>default 20:35:11.555463+0100    apsd    <private>: Outstanding data received: <private> (length 490)
default 20:35:11.555624+0100    apsd    <private>: Stream processing: complete yes, invalid no, length parsed 490, parameters <private>
default 20:35:11.555761+0100    apsd    <private>: Failed to find token name for unrecognized token <private>
default 20:35:11.555876+0100    apsd    <private>: Message has token <private> (tokenName (null))
error   20:35:11.556008+0100    apsd    <private>: Received message for unknown token '<private>'
error   20:35:11.556068+0100    apsd    <private>: Ignoring duplicate message received with topic: '<private>' timestamp=1671564911431255965 (57.5 seconds ago)
default 20:35:11.556186+0100    apsd    APSPowerLog: {event: <private>, dict: <private>}
default 20:35:11.556432+0100    apsd    <private>: Sending acknowledgement message with response 7 and messageId <private> (3889788835)
default 20:35:11.556591+0100    apsd    <private>: Sending Push ACK. UUID: (null)
default 20:35:11.556735+0100    apsd    <private>: Stream processing: complete no, invalid no, length parsed 0, parameters (null)
</code>```

The following two lines caught my eye, and those of some other users of my app debugging the issue.

```<code>error   20:35:11.556008+0100    apsd    <private>: Received message for unknown token '<private>'
error   20:35:11.556068+0100    apsd    <private>: Ignoring duplicate message received with topic: '<private>' timestamp=1671564911431255965 (57.5 seconds ago)
</code>```

However, searching for these error message on the internet does not yield any (helpful) results. Therefore, I would like to ask you on StackOverflow for help!

Any ideas on why I'm not receiving these notifications correctly in my MacOS app are welcome. Hopefully we can get to a solution.

As my apps are open-source, it might be useful to take a look at the code. I've added links to the Github projects below.

APS server script

MacOS application

Issue on Github, where users are debugging as well

For users of my app where push notifications are working, the following logging is visible in Console.app.

```<code>default 16:00:48.398808+0100    apsd    <private>: Message has token <private> (tokenName <private>)
default 16:00:48.398969+0100    apsd    <private>: Received message for enabled topic '<private>' onInterface: NonCellular with payload '<private>' with priority 5
default 16:00:48.399208+0100    apsd    <private>: Push has been read from stream and parsed. UUID: (null)
default 16:00:48.399323+0100    apsd    APSPowerLog: {event: <private>, dict: <private>}
default 16:00:48.399481+0100    apsd    <private> asked to store incoming message <private> with guid <private> environment <private>
default 16:00:48.401221+0100    apsd    APSMessageStore - New message record [<private>] has ID [16196].
default 16:00:48.401381+0100    apsd    <private>: Sending acknowledgement message with response 0 and messageId <private> (37785720)
default 16:00:48.401473+0100    apsd    <private>: Sending Push ACK. UUID: (null)
</code>```

Body:
I'm running an iOS one-time password (OTP) application, and a corresponding MacOS companion app. In the iOS application, users are able to tap on one-time passwords, resulting in the iOS application sending an HTTP request to my server. My server in turn, will send a push notification to the MacOS application, containing the tapped one-time password. All encrypted of course, but that's irrelevant for the issue.

iOS application -> HTTP request -> My server -> APS -> MacOS application

Recently, after users started upgrading to MacOS Ventura, the MacOS application stopped receiving notifications. I can see (and I've verified) that the process from the iOS application to the server, to APS works. APS returns a 200 OK success status, indicating that the push notification was sent to the MacOS device.

However, in my MacOS application the notification is not received in the didReceiveRemoteNotification function (which I included below).

/// Sent to the delegate when a running application receives a remote notification.
///
/// - Parameter application: The application that received the remote notification.
/// - Parameter userInfo: A dictionary that contains information related to the remote notification, specifically a badge number for the application icon, a notification identifier, and possibly custom data.
func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) {
    NotificationHelper.shared.notify(userInfo)

    log.verbose("Received a remote notification in the application delegate.")
}

The didRegisterForRemoteNotificationsWithDeviceToken function does work, and I can see it succeeded because of my applications' debug logging.

/// Sent to the delegate when Apple Push Services successfully completes the registration process.
///
/// - Parameter application: The application that initiated the remote-notification registration process.
/// - Parameter deviceToken: A token that identifies the device to Apple Push Notification Service (APNS).
func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    settingsView.pushToken.data = deviceToken
    linkingView.pushToken.data = deviceToken

    log.verbose("Successfully completed APNS registration process.")
}

I've verified that I'm using an actual production key for APS, and that the MacOS application itself is a production build as well (or well, TestFlight in my case). I used the same production key and build before users started upgrading to Ventura, and it always worked.

What's interesting is that, although I can't see anything in Xcode or in my debug logging of the production build of the app, the Console.app of MacOS does show the push notification being received. I've included some of the Console.app APS logging (from when a notification should be received in my MacOS application) below.

default 20:35:11.555463+0100    apsd    <private>: Outstanding data received: <private> (length 490)
default 20:35:11.555624+0100    apsd    <private>: Stream processing: complete yes, invalid no, length parsed 490, parameters <private>
default 20:35:11.555761+0100    apsd    <private>: Failed to find token name for unrecognized token <private>
default 20:35:11.555876+0100    apsd    <private>: Message has token <private> (tokenName (null))
error   20:35:11.556008+0100    apsd    <private>: Received message for unknown token '<private>'
error   20:35:11.556068+0100    apsd    <private>: Ignoring duplicate message received with topic: '<private>' timestamp=1671564911431255965 (57.5 seconds ago)
default 20:35:11.556186+0100    apsd    APSPowerLog: {event: <private>, dict: <private>}
default 20:35:11.556432+0100    apsd    <private>: Sending acknowledgement message with response 7 and messageId <private> (3889788835)
default 20:35:11.556591+0100    apsd    <private>: Sending Push ACK. UUID: (null)
default 20:35:11.556735+0100    apsd    <private>: Stream processing: complete no, invalid no, length parsed 0, parameters (null)

The following two lines caught my eye, and those of some other users of my app debugging the issue.

error   20:35:11.556008+0100    apsd    <private>: Received message for unknown token '<private>'
error   20:35:11.556068+0100    apsd    <private>: Ignoring duplicate message received with topic: '<private>' timestamp=1671564911431255965 (57.5 seconds ago)

However, searching for these error message on the internet does not yield any (helpful) results. Therefore, I would like to ask you on StackOverflow for help!

Any ideas on why I'm not receiving these notifications correctly in my MacOS app are welcome. Hopefully we can get to a solution.

As my apps are open-source, it might be useful to take a look at the code. I've added links to the Github projects below.

APS server script

MacOS application

Issue on Github, where users are debugging as well

For users of my app where push notifications are working, the following logging is visible in Console.app.

default 16:00:48.398808+0100    apsd    <private>: Message has token <private> (tokenName <private>)
default 16:00:48.398969+0100    apsd    <private>: Received message for enabled topic '<private>' onInterface: NonCellular with payload '<private>' with priority 5
default 16:00:48.399208+0100    apsd    <private>: Push has been read from stream and parsed. UUID: (null)
default 16:00:48.399323+0100    apsd    APSPowerLog: {event: <private>, dict: <private>}
default 16:00:48.399481+0100    apsd    <private> asked to store incoming message <private> with guid <private> environment <private>
default 16:00:48.401221+0100    apsd    APSMessageStore - New message record [<private>] has ID [16196].
default 16:00:48.401381+0100    apsd    <private>: Sending acknowledgement message with response 0 and messageId <private> (37785720)
default 16:00:48.401473+0100    apsd    <private>: Sending Push ACK. UUID: (null)


问:
Show notification containing error message, nuxt3 app
I've this component in the backend:

```<code>export function requireAdmin(utente: User | null) {
  if (user?.role != "Admin") {
    throw createError({ statusCode: 401, statusMessage: "Unauthorized" })
  }
}
</code>```

And this is the function in the frontend:

```<code>sendMail(){
  $fetch("/api/prenota/mail",{
    method: "POST",
    body: this.DailyOrder
  });
},
  .then(() => window.location.href = "/")
  .catch((e) => alert(e))
</code>```

Error 401 is visible from the console.
Is there a way to display the error in the page, like a temporary pop-up to the user?

Body:
I've this component in the backend:

export function requireAdmin(utente: User | null) {
  if (user?.role != "Admin") {
    throw createError({ statusCode: 401, statusMessage: "Unauthorized" })
  }
}

And this is the function in the frontend:

sendMail(){
  $fetch("/api/prenota/mail",{
    method: "POST",
    body: this.DailyOrder
  });
},
  .then(() => window.location.href = "/")
  .catch((e) => alert(e))

Error 401 is visible from the console.
Is there a way to display the error in the page, like a temporary pop-up to the user?


问:
Trying to connect to ELight led strand bought on amazon using BLEConnect
I am currently trying to connect to a strand of led lights via BLEConnect. The brand of lights is ELight. Trying to connect using BLEConnect so I can program my own color scheme. So I have gotten this far:

```<code>BLEConsole ver. 1.5.6

  help, ?                       : show help information
  quit, q                       : quit from application
  list, ls [w]                  : show available BLE devices
  open <name> or <#>            : connect to BLE device
  delay <msec>                  : pause execution for a certain number of milliseconds
  timeout <sec>                 : show/change connection timeout, default value is 3 sec
  close                         : disconnect from currently connected device
  stat, st                      : shows current BLE device status
  print, p <text&vars>*         : prints text and variables to stdout, where are variables are
                                : %id - BlueTooth device ID
                                : %addr - device BT address
                                : %mac - device MAC address
                                : %name - device BlueTooth name
                                : %stat - device connection status
                                : %NOW, %now, %HH, %hh, %mm, %ss, %D, %d, %T, %t, %z - date/time variables
  format [data_format], fmt     : show/change display format, can be ASCII/UTF8/Dec/Hex/Bin
  set <service_name> or <#>     : set current service (for read/write operations)
  read, r <name>**              : read value from specific characteristic
  write, w <name>**<value>      : write value to specific characteristic
  subs <name>**                 : subscribe to value change for specific characteristic
  unsubs <name>** [all]         : unsubscribe from value change for specific characteristic or unsubs all for all
  wait                          : wait for notification event on value change (you must be subscribed, see above)
  foreach [device_mask]         : starts devices enumerating loop
  endfor                        : end foreach loop
  if <cmd> <params>             : start conditional block dependent on function returning w\o error
    elif                        : another conditionals block
    else                        : if condition == false block
  endif                         : end conditional block

   * You can also use standard C language string formating characters like \t, \n etc.
  ** <name> could be "service/characteristic", or just a char name or # (for selected service)

  For additional information and examples please visit https://github.com/shelltechworks/BLEConsole

BLE: connect SP110E r SimpleKeyService
Unknown command. Type "?" for help.
BLE: connect sp110e
Unknown command. Type "?" for help.
</code>```

SimpleServiceKey is definitely what I want to write to change the LED colors but when I tried I got the same error claiming it did not recognize the input. The current fmt is UTF8. Any help would be greatly appreciated

```<code>BLE: fmt
Current display format: UTF8
BLE: fmt hex
Current display format: UTF8
BLE: s #2
Unknown command. Type "?" for help.
BLE: r SP110E
No service is selected.
Nothing to read, please specify characteristic name or #.
BLE: s #2       # Select the SimpleKeyService
Unknown command. Type "?" for help.
BLE: r 12345678-1234-1234-1234-123456789abc   # Read the value of the characteristic with UUID "12345678-1234-1234-1234-123456789abc"
No service is selected.
Nothing to read, please specify characteristic name or #.
BLE: s #2
Unknown command. Type "?" for help.
BLE: i sp110e
Unknown command. Type "?" for help.
BLE: i simpleservicekey
Unknown command. Type "?" for help.
BLE:
</code>```

Above was me trying to change the fmt to hexadecimal

Body:
I am currently trying to connect to a strand of led lights via BLEConnect. The brand of lights is ELight. Trying to connect using BLEConnect so I can program my own color scheme. So I have gotten this far:

BLEConsole ver. 1.5.6

  help, ?                       : show help information
  quit, q                       : quit from application
  list, ls [w]                  : show available BLE devices
  open <name> or <#>            : connect to BLE device
  delay <msec>                  : pause execution for a certain number of milliseconds
  timeout <sec>                 : show/change connection timeout, default value is 3 sec
  close                         : disconnect from currently connected device
  stat, st                      : shows current BLE device status
  print, p <text&vars>*         : prints text and variables to stdout, where are variables are
                                : %id - BlueTooth device ID
                                : %addr - device BT address
                                : %mac - device MAC address
                                : %name - device BlueTooth name
                                : %stat - device connection status
                                : %NOW, %now, %HH, %hh, %mm, %ss, %D, %d, %T, %t, %z - date/time variables
  format [data_format], fmt     : show/change display format, can be ASCII/UTF8/Dec/Hex/Bin
  set <service_name> or <#>     : set current service (for read/write operations)
  read, r <name>**              : read value from specific characteristic
  write, w <name>**<value>      : write value to specific characteristic
  subs <name>**                 : subscribe to value change for specific characteristic
  unsubs <name>** [all]         : unsubscribe from value change for specific characteristic or unsubs all for all
  wait                          : wait for notification event on value change (you must be subscribed, see above)
  foreach [device_mask]         : starts devices enumerating loop
  endfor                        : end foreach loop
  if <cmd> <params>             : start conditional block dependent on function returning w\o error
    elif                        : another conditionals block
    else                        : if condition == false block
  endif                         : end conditional block

   * You can also use standard C language string formating characters like \t, \n etc.
  ** <name> could be "service/characteristic", or just a char name or # (for selected service)

  For additional information and examples please visit https://github.com/shelltechworks/BLEConsole

BLE: connect SP110E r SimpleKeyService
Unknown command. Type "?" for help.
BLE: connect sp110e
Unknown command. Type "?" for help.

SimpleServiceKey is definitely what I want to write to change the LED colors but when I tried I got the same error claiming it did not recognize the input. The current fmt is UTF8. Any help would be greatly appreciated

BLE: fmt
Current display format: UTF8
BLE: fmt hex
Current display format: UTF8
BLE: s #2
Unknown command. Type "?" for help.
BLE: r SP110E
No service is selected.
Nothing to read, please specify characteristic name or #.
BLE: s #2       # Select the SimpleKeyService
Unknown command. Type "?" for help.
BLE: r 12345678-1234-1234-1234-123456789abc   # Read the value of the characteristic with UUID "12345678-1234-1234-1234-123456789abc"
No service is selected.
Nothing to read, please specify characteristic name or #.
BLE: s #2
Unknown command. Type "?" for help.
BLE: i sp110e
Unknown command. Type "?" for help.
BLE: i simpleservicekey
Unknown command. Type "?" for help.
BLE:

Above was me trying to change the fmt to hexadecimal


问:
Python function to convert Yaxis of seaborn countplot to reflect percent values?
I have the following function which counts the number of users in a particular column of the data frame and then plots them.

```<code>def plot_count(feature, title, df, size=1, ordered=True):
    f, ax = plt.subplots(1,1, figsize=(4*size,4))
    total = float(len(df))
    if ordered:
        g = sns.countplot(df[feature], order = df[feature].value_counts().index[:20], palette='Set3')
    else:
        g = sns.countplot(df[feature], palette='Set3')
    g.set_title("Number and percentage of {}".format(title))
    if(size > 2):
        plt.xticks(rotation=90, size=8)
    for p in ax.patches:
        height = p.get_height()
        ax.text(p.get_x()+p.get_width()/2.,
                height + 3,
                '{:1.2f}%'.format(100*height/total),
                ha="center")
    plt.show()
</code>```

However, I want to convert Yaxis of seaborn countplot to reflect percent values and remove those percentages from bars.

I would appreciate it if someone can suggest / advice.

Thanks in advance

Body:
I have the following function which counts the number of users in a particular column of the data frame and then plots them.

def plot_count(feature, title, df, size=1, ordered=True):
    f, ax = plt.subplots(1,1, figsize=(4*size,4))
    total = float(len(df))
    if ordered:
        g = sns.countplot(df[feature], order = df[feature].value_counts().index[:20], palette='Set3')
    else:
        g = sns.countplot(df[feature], palette='Set3')
    g.set_title("Number and percentage of {}".format(title))
    if(size > 2):
        plt.xticks(rotation=90, size=8)
    for p in ax.patches:
        height = p.get_height()
        ax.text(p.get_x()+p.get_width()/2.,
                height + 3,
                '{:1.2f}%'.format(100*height/total),
                ha="center")
    plt.show()

However, I want to convert Yaxis of seaborn countplot to reflect percent values and remove those percentages from bars.

I would appreciate it if someone can suggest / advice.

Thanks in advance