<div dir="ltr"><div>Hello,</div><div><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Summary:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">This FFmpeg error, "Error submitting a packet to the muxer: End of file," occurs during RTMP stream transcoding when an overlay is applied. The issue is reproducible with image2 or rawvideo overlay inputs, appearing intermittently between 5 minutes and 8+ hours of streaming, not at startup. The error originates in `fftools/ffmpeg_mux.c:write_packet()` and traces back to `libavformat/librtmp.c:RTMP_write()`. This function requires a size argument greater than 11 bytes, but the error triggers when a small FLV packet (1-4 bytes) is passed. The source of these small packets is currently unknown, though custom logging indicates the RTMP connection remains active. The RTMP source is a Linux machine with a stable fiber optic internet connection.</span></p></div><div><span id="gmail-docs-internal-guid-8a77b6ce-7fff-a542-fe3f-162d2b883077"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline"><br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">System:</span></p><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">ffmpeg n7.1.1</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;color:rgb(14,14,14);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">OS Distribution: Ubuntu 22.04.5 LTS (Jammy)</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;color:rgb(14,14,14);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Kernel Version: 5.15.0-130-generic</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;color:rgb(14,14,14);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Kernel Build: #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:12pt" role="presentation"><span style="font-size:10pt;color:rgb(14,14,14);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Architecture: x86_64</span></p></li></ul><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Error: “</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Error submitting a packet to the muxer: End of file”</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Raised:</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline"> fftools/ffmpeg_mux.c:write_packet:239</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Source:</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline"> libavformat/librtmp.c:RTMP_write:206</span></p><ul style="margin-top:0px;margin-bottom:0px"><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">call to RTMP_write() returns 0 because the size argument is less that 11 bytes</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">I have seen the size arg anywhere from 1-4 bytes throughout testing</span></p></li><li dir="ltr" style="list-style-type:disc;font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline;white-space:pre"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt" role="presentation"><span style="font-size:10pt;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">The write fails but RTMP connection still appears to be active</span></p></li></ul><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">Command:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">ffmpeg -hide_banner -y \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-f flv -i rtmp://<host>:<port>/<app>/<stream_key> \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-f image2 -framerate 30 -stream_loop -1 -i /Volumes/<ramdisk_name>/<image_file>.bmp \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-filter_complex "[0:v][1:v] overlay=(main_w-overlay_w)/2:0 [vout]" \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-map "[vout]" -map 0:a \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-c:v libx264 -preset veryfast -b:v 2200K \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-c:a aac -b:a 96K \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-max_muxing_queue_size 8192 \</span></p><p dir="ltr" style="line-height:1.38;margin-left:36pt;margin-top:0pt;margin-bottom:0pt"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline">-f flv rtmp://<host>:<port>/<app>/<stream_key></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;vertical-align:baseline"><b>Terminal:</b></span></p></span></div><div><font size="1">root@vengine-d0-002:~#   ffmpeg -hide_banner -y \<br>  -f flv -i rtmp://<host>:<port>/<app>/<stream_key> \<br>  -f image2 -framerate 30 -stream_loop -1 -i /Volumes/ramdisk/olay-png/to_nimble.bmp \<br>  -filter_complex "[0:v][1:v] overlay=(main_w-overlay_w)/2:0 [vout]" \<br>  -map "[vout]" -map 0:a \<br>  -c:v libx264 -preset veryfast -b:v 2200K \<br>  -c:a aac -b:a 96K \<br>  -max_muxing_queue_size 8192 \<br>  -f flv rtmp://<host>:<port>/<app>/<stream_key><br>Metadata:<br>  duration              0.00<br>  width                 1280.00<br>  height                720.00<br>  videodatarate         2441.41<br>  framerate             30.00<br>  videocodecid          7.00<br>  audiodatarate         125.00<br>  audiosamplerate       44100.00<br>  audiosamplesize       16.00<br>  stereo                TRUE<br>  audiocodecid          10.00<br>  encoder               Lavf58.76.100<br>  filesize              0.00<br>Input #0, flv, from 'rtmp://<host>:<port>/<app>/<stream_key>':<br>  Metadata:<br>    encoder         : Lavf58.76.100<br>  Duration: 00:00:00.00, start: 7806.432000, bitrate: N/A<br>  Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s<br>  Stream #0:1: Video: h264 (High), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 2500 kb/s, 30 fps, 30 tbr, 1k tbn<br>Input #1, image2, from '/Volumes/ramdisk/olay-png/to_nimble.bmp':<br>  Duration: 00:00:00.03, start: 0.000000, bitrate: N/A<br>  Stream #1:0: Video: bmp, bgra, 1280x720, 30 fps, 30 tbr, 30 tbn<br>Stream mapping:<br>  Stream #0:1 (h264) -> overlay<br>  Stream #1:0 (bmp) -> overlay<br>  overlay:default -> Stream #0:0 (libx264)<br>  Stream #0:0 -> #0:1 (aac (native) -> aac (native))<br>Press [q] to stop, [?] for help<br>[libx264 @ 0x7fae13dbaec0] using SAR=1/1<br>[libx264 @ 0x7fae13dbaec0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512<br>[libx264 @ 0x7fae13dbaec0] profile High, level 3.1, 4:2:0, 8-bit<br>[libx264 @ 0x7fae13dbaec0] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - <a href="http://www.videolan.org/x264.html">http://www.videolan.org/x264.html</a> - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=abr mbtree=1 bitrate=2200 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00<br>Output #0, flv, to 'rtmp://<host>:<port>/<app>/<stream_key>':<br>  Metadata:<br>    encoder         : Lavf61.7.100<br>  Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2200 kb/s, 30 fps, 1k tbn<br>      Metadata:<br>        encoder         : Lavc61.19.101 libx264<br>      Side data:<br>        cpb: bitrate max/min/avg: 0/0/2200000 buffer size: 0 vbv_delay: N/A<br>  Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 96 kb/s<br>      Metadata:<br>        encoder         : Lavc61.19.101 aac<br>[vost#0:0/libx264 @ 0x7fae14066080] Error submitting a packet to the muxer: End of filed=1.29x    <br>[flv @ 0x7fae13e4e580] Failed to update header with correct duration.<br>[flv @ 0x7fae13e4e580] Failed to update header with correct filesize.<br>[out#0/flv @ 0x7fae14069100] Error writing trailer: End of file<br>[out#0/flv @ 0x7fae14069100] Error closing file: End of file<br>[out#0/flv @ 0x7fae14069100] video:1599KiB audio:3KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.706515%<br>frame=  228 fps= 30 q=-1.0 Lsize=    1613KiB time=00:00:09.46 bitrate=1396.2kbits/s speed=1.24x    <br>[libx264 @ 0x7fae13dbaec0] frame I:2     Avg QP:10.03  size:116327<br>[libx264 @ 0x7fae13dbaec0] frame P:76    Avg QP:11.89  size: 18555<br>[libx264 @ 0x7fae13dbaec0] frame B:186   Avg QP:16.22  size:  2018<br>[libx264 @ 0x7fae13dbaec0] consecutive B-frames:  0.8%  0.0% 47.7% 51.5%<br>[libx264 @ 0x7fae13dbaec0] mb I  I16..4: 67.0%  0.5% 32.4%<br>[libx264 @ 0x7fae13dbaec0] mb P  I16..4:  1.3%  0.0%  0.8%  P16..4:  7.8%  1.0%  1.8%  0.0%  0.0%    skip:87.3%<br>[libx264 @ 0x7fae13dbaec0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.7%  0.2%  0.3%  direct: 0.6%  skip:98.1%  L0:40.9% L1:38.2% BI:20.8%<br>[libx264 @ 0x7fae13dbaec0] final ratefactor: 6.43<br>[libx264 @ 0x7fae13dbaec0] 8x8 transform intra:0.6% inter:12.0%<br>[libx264 @ 0x7fae13dbaec0] coded y,uvDC,uvAC intra: 33.2% 31.2% 30.0% inter: 2.2% 2.3% 1.5%<br>[libx264 @ 0x7fae13dbaec0] i16 v,h,dc,p: 81% 18%  1%  0%<br>[libx264 @ 0x7fae13dbaec0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 24% 26%  3%  4%  3%  5%  3%  3%<br>[libx264 @ 0x7fae13dbaec0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 20% 12%  5%  5%  7%  6%  7%  6%<br>[libx264 @ 0x7fae13dbaec0] i8c dc,h,v,p: 57% 20% 20%  2%<br>[libx264 @ 0x7fae13dbaec0] Weighted P-Frames: Y:0.0% UV:0.0%<br>[libx264 @ 0x7fae13dbaec0] kb/s:1834.61<br>[aac @ 0x7fae13dbbe80] Qavg: 65536.000<br>Conversion failed!</font></div><div><br></div><div>Any insight is greatly appreciated!<br><br>Best,</div><div><br></div><div>Pierce</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><br></p></span></div></div></div></div>