Copied memory block seemingly too small for frame buffer
I keep getting this error when I try run reSnap.sh. I am working with a mac and a remarkable 2, running software version 3.16.2.3.
% ./reSnap.sh
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with Apple clang version 16.0.0 (clang-1600.0.26.4)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.100 / 61. 19.100
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
[rawvideo @ 0x134e05740] Packet corrupt (stream = 0, dts = 0).
Input #0, rawvideo, from 'fd:':
Duration: N/A, start: 0.000000, bitrate: 1051315 kb/s
Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le, 1872x1404, 1051315 kb/s, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> png (native))
[in#0/rawvideo @ 0x600002648100] corrupt input packet in stream 0
[rawvideo @ 0x134e07b00] Invalid buffer size, packet size 1126393 < expected frame_size 5256576
[vist#0:0/rawvideo @ 0x134e05e60] [dec:rawvideo @ 0x134e06db0] Error submitting packet to decoder: Invalid argument
[vist#0:0/rawvideo @ 0x134e05e60] [dec:rawvideo @ 0x134e06db0] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/rawvideo @ 0x134e05e60] [dec:rawvideo @ 0x134e06db0] Task finished with error code: -1145393733 (Error number -1145393733 occurred)
[vist#0:0/rawvideo @ 0x134e05e60] [dec:rawvideo @ 0x134e06db0] Terminating thread with return code -1145393733 (Error number -1145393733 occurred)
[vf#0:0 @ 0x134e071e0] No filtered frames for output stream, trying to initialize anyway.
Output #0, image2, to '/tmp/reSnap/snapshot_2025-01-16_19-02-30.png':
Metadata:
encoder : Lavf61.7.100
Stream #0:0: Video: png, rgb24(progressive), 1404x1872, q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc61.19.100 png
[out#0/image2 @ 0x600002f4c000] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
[out#0/image2 @ 0x600002f4c000] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A
Conversion failed!
feh WARNING: /tmp/reSnap/snapshot_2025-01-16_19-02-30.png does not exist - skipping
feh: No loadable images specified.
See 'man feh' for detailed usage information
Some inspection suggested that the memory map after /dev/fb0 is just too small to be the frame buffer, ranging from addresses 6fe00000-6ff00000.
The relevant lines of the map file:
6dcdc000-6e642000 rw-p 00000000 00:00 0
6e642000-6fe00000 rw-s a9d00000 00:06 1138 /dev/fb0
6fe00000-6ff00000 rw-p 00000000 00:00 0
That is unfortunate. Thank you for the detailed report.
Let me see, whether I can do something about it.
Sorry, I could not reproduce this. I am also using the reMarkable 2 and am on version 3.11.2.5
My output:
ffmpeg version 5.1.4 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 14 (SUSE Linux)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --optflags='-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --enable-version3 --enable-libsmbclient --disable-openssl --enable-gnutls --enable-ladspa --enable-libshaderc --enable-vulkan --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdc1394 --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libjack --enable-librist --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopenh264-dlopen --enable-libopus --enable-libpulse --enable-librav1e --enable-librubberband --enable-libsvtav1 --enable-libsoxr --enable-libspeex --enable-libssh --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lto --enable-lv2 --enable-vaapi --enable-vdpau --enable-version3 --enable-libfdk-aac-dlopen --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libx264 --enable-libx265 --enable-libxvid
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
Input #0, rawvideo, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: 1051315 kb/s
Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le, 1872x1404, 1051315 kb/s, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> png (native))
Output #0, image2, to '/tmp/reSnap/snapshot_2025-01-18_14-55-54.png':
Metadata:
encoder : Lavf59.27.100
Stream #0:0: Video: png, rgb24(pc, gbr/unknown/unknown, progressive), 1404x1872, q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc59.37.100 png
[image2 @ 0x561b48d2d940] The specified filename '/tmp/reSnap/snapshot_2025-01-18_14-55-54.png' does not contain an image sequence pattern or a pattern is invalid.
[image2 @ 0x561b48d2d940] Use a pattern such as %03d for an image sequence or use the -update option (with -frames:v 1 if needed) to write a single image.
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A speed=0.444x
video:51kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
It is a little strange that I am 2 major versions behind the ffmpeg version you are using...
Update:
I have now also tested it with ffmpeg versions 6 and 7. Still works for me.
Update 2: Ok the update did not load correctly, I could reproduce this. Will take a look at it
I am also getting this issue on my Remarkable 2, software version 3.16.2.3 (same as OP).
I am also using ffmpeg 7.1, and errors look very similar to OP . Please let me know if there's any debugging I can help do.
$ bash reSnap.sh -s remarkable -n
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.100 / 61. 19.100
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
[rawvideo @ 0x149606a20] Packet corrupt (stream = 0, dts = 0).
Input #0, rawvideo, from 'fd:':
Duration: N/A, start: 0.000000, bitrate: 1051315 kb/s
Stream #0:0: Video: rawvideo (Y1[0][16] / 0x10003159), gray16le, 1872x1404, 1051315 kb/s, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> png (native))
[in#0/rawvideo @ 0x600002ef0300] corrupt input packet in stream 0
[rawvideo @ 0x149607cc0] Invalid buffer size, packet size 1146873 < expected frame_size 5256576
[vist#0:0/rawvideo @ 0x149704bc0] [dec:rawvideo @ 0x149606f70] Error submitting packet to decoder: Invalid argument
[vist#0:0/rawvideo @ 0x149704bc0] [dec:rawvideo @ 0x149606f70] Decode error rate 1 exceeds maximum 0.666667
[vist#0:0/rawvideo @ 0x149704bc0] [dec:rawvideo @ 0x149606f70] Task finished with error code: -1145393733 (Error number -1145393733 occurred)
[vist#0:0/rawvideo @ 0x149704bc0] [dec:rawvideo @ 0x149606f70] Terminating thread with return code -1145393733 (Error number -1145393733 occurred)
[vf#0:0 @ 0x1496073a0] No filtered frames for output stream, trying to initialize anyway.
Output #0, image2, to '/tmp/reSnap/snapshot_2025-02-01_14-33-31.png':
Metadata:
encoder : Lavf61.7.100
Stream #0:0: Video: png, rgb24(progressive), 1404x1872, q=2-31, 200 kb/s, 25 fps, 25 tbn
Metadata:
encoder : Lavc61.19.100 png
[out#0/image2 @ 0x6000027f4000] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
[out#0/image2 @ 0x6000027f4000] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A
Conversion failed!
I just did a factory reset and now it works again for me.
The problem was actually lz4. Try removing the lz4 binary at /home/root/lz4 and taking a snapshot.