Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
He spells things wrong intentionally because he prefers the appearance of certain words. He is quite, quite weird.
He is native Chinese but learned English by reading The Camel Book.

For Personal Computing math, audio, and visual exercise, a practical approach may be: Reaper with API python scripting and GNUplot for math visualizations. I think tech as a means in and for itself, especially if it doesn't pay, being a huge time sink in the context of so, so many other pressing very complex issues (fixing a broken lawnmower today for example) arise constantly in everyday life, then low level vulkan and programming epic demoscenes might be a little too much extra.
 
Am I a dumb niggerfaggot or does matroska misbehave when it comes to metadata and thumbnail handling? It makes me want to pull my hairs out when I output an encode to it using ffmpeg.
 
Am I a dumb niggerfaggot or does matroska misbehave when it comes to metadata and thumbnail handling? It makes me want to pull my hairs out when I output an encode to it using ffmpeg.
Can't tell without error messages
For Personal Computing math, audio, and visual exercise, a practical approach may be: Reaper with API python scripting and GNUplot for math visualizations.
SageMath has a high-level plotting interface based on matplotlib (which on its own can be a bit primitive and a pain to use):
 
  • Informative
  • Like
Reactions: Croco and Safir
Rust is the language that powers the Kiwi Farms, which is basically Nazi Germany if you think about it.
Well, yes, but, unfortunately, writing rust saves lives of journalists, so I'd rather have everything written in C++

1751448194148.webp
 
>Implying Rust is the only memory safe language
Xhey are so narrow-sighted it's insane.
LoL, are they trying to sell Rust as a "secure" language? I mean, it's a programming fucking language, not an application. Do troons ever get tired of lying?
(I don't have much expertise, if anyone wants to correct me, feel free to add any info).
 
>Implying Rust is the only memory safe language
Xhey are so narrow-sighted it's insane.
for a high-level application like a chat app, a good first choice would be a memory safe garbage-collected applications language such as java (but not necessarily java in particular)
system programming languages like rust or c are just overkill unless you really need them, and even then you should probably just use them for a couple things and ffi into them from your chosen high-level language
LoL, are they trying to sell Rust as a "secure" language? I mean, it's a programming fucking language, not an application. Do troons ever get tired of lying?
(I don't have much expertise, if anyone wants to correct me, feel free to add any info).
the troons are actually right here (rust actually does make it basically impossible to make a large class of errors) but everything else about rust is so cancerous that even a lot of security-minded c programmers avoid touching it
(and the troons are somehow among the least cancerous things about rust, believe it or not. it sucks that bad)
 
Well, yes, but, unfortunately, writing rust saves lives of journalists, so I'd rather have everything written in C++

I don't think "journalists will die if you don't use rust" is motivating in the way this retard intended it
 
Can't tell without error messages
There's no error per se but I can share the console output. The important stream here is #4 (input), #1 (output) which is a thumbnail. The input .mp4 file embeds it just fine but when muxing it to a matroska container, the thumbnail is copied but not set as a thumbnail even though the flag -disposition:v:1 attached_pic was typed. ffmpeg is initially fooled into thinking it has been set as a thumbnail but a later glance with ffprobe and the fact I can't see it in File Explorer says otherwise. I guess matroska treats image files as a single frame video and thus can't display them as thumbnails because it claims to have a framerate of 30k fps.
Code:
ffmpeg -i test.mp4 -map v -map a -c copy -disposition:v:1 attached_pic out.mkv
ffmpeg version N-116234-gd4c1ad1f5c-g1a86a7a48d+2 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 14.1.0 (Rev3, Built by MSYS2 project)
  configuration:  --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-libfdk-aac --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libharfbuzz --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libopenmpt --enable-version3 --enable-librav1e --enable-libsrt --enable-libgsm --enable-libvmaf --enable-libsvtav1 --enable-chromaprint --enable-decklink --enable-frei0r --enable-libaribb24 --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfribidi --enable-libgme --enable-libilbc --enable-libsvthevc --enable-libkvazaar --enable-libmodplug --enable-librist --enable-librtmp --enable-librubberband --enable-libtesseract --enable-libxavs --enable-libzmq --enable-libzvbi --enable-openal --enable-libcodec2 --enable-ladspa --enable-libglslang --enable-vulkan --enable-libdavs2 --enable-libxavs2 --enable-libuavs3d --enable-libplacebo --enable-libjxl --enable-opencl --enable-opengl --enable-libopenh264 --enable-openssl --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DCACA_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCHROMAPRINT_NODLL --extra-cflags=-DZMQ_STATIC --extra-libs=-lpsapi --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cflags=-DKVZ_STATIC_LIB --enable-nonfree --extra-cflags=-DAL_LIBTYPE_STATIC --extra-cflags='-IC:/ffmpeg/local64/include' --extra-cflags='-IC:/ffmpeg/local64/include/AL'
  libavutil      59. 28.100 / 59. 28.100
  libavcodec     61. 10.100 / 61. 10.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000016578780d00] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    title           : COURAGE THE COWARDLY DOG SEASON 1 DISC 1
    encoder         : Lavf61.5.101
  Duration: 00:01:14.58, start: 0.000000, bitrate: 6170 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 74.124000
      Metadata:
        title           : Chapter 02
  Stream #0:0[0x1](eng): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, smpte170m/smpte170m/bt709), 1456x1080 [SAR 270:271 DAR 364:271], 5958 kb/s, 23.98 fps, 23.98 tbr, 16k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](eng): Subtitle: dvd_subtitle (dvdsub) (mp4s / 0x7334706D), 720x480, 3 kb/s (default)
      Metadata:
        handler_name    : SubtitleHandler
  Stream #0:3[0x5](eng): Data: bin_data (text / 0x74786574), 0 kb/s
      Metadata:
        handler_name    : SubtitleHandler
  Stream #0:4[0x0]: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1080x1328 [SAR 1:1 DAR 135:166], 90k tbr, 90k tbn (attached pic)
File 'out.mkv' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:4 -> #0:1 (copy)
  Stream #0:1 -> #0:2 (copy)
Output #0, matroska, to 'out.mkv':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    title           : COURAGE THE COWARDLY DOG SEASON 1 DISC 1
    encoder         : Lavf61.5.101
  Chapters:
    Chapter #0:0: start 0.000000, end 74.124000
      Metadata:
        title           : Chapter 02
  Stream #0:0(eng): Video: hevc (Main 10) (hev1 / 0x31766568), yuv420p10le(tv, smpte170m/smpte170m/bt709), 1456x1080 [SAR 270:271 DAR 364:271], q=2-31, 5958 kb/s, 23.98 fps, 23.98 tbr, 1k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
  Stream #0:1: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 1080x1328 [SAR 1:1 DAR 135:166], q=2-31, 90k tbr, 1k tbn (attached pic)
  Stream #0:2(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 192 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id       : [0][0][0][0]
Press [q] to stop, [?] for help
[out#0/matroska @ 00000165787863c0] video:54323KiB audio:1748KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.073289%
size=   56112KiB time=N/A bitrate=N/A speed=N/A
Code:
ffprobe out.mkv
ffprobe version N-116234-gd4c1ad1f5c-g1a86a7a48d+2 Copyright (c) 2007-2024 the FFmpeg developers
  built with gcc 14.1.0 (Rev3, Built by MSYS2 project)
  configuration:  --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-libfdk-aac --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libharfbuzz --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libopenmpt --enable-version3 --enable-librav1e --enable-libsrt --enable-libgsm --enable-libvmaf --enable-libsvtav1 --enable-chromaprint --enable-decklink --enable-frei0r --enable-libaribb24 --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfribidi --enable-libgme --enable-libilbc --enable-libsvthevc --enable-libkvazaar --enable-libmodplug --enable-librist --enable-librtmp --enable-librubberband --enable-libtesseract --enable-libxavs --enable-libzmq --enable-libzvbi --enable-openal --enable-libcodec2 --enable-ladspa --enable-libglslang --enable-vulkan --enable-libdavs2 --enable-libxavs2 --enable-libuavs3d --enable-libplacebo --enable-libjxl --enable-opencl --enable-opengl --enable-libopenh264 --enable-openssl --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DCACA_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCHROMAPRINT_NODLL --extra-cflags=-DZMQ_STATIC --extra-libs=-lpsapi --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cflags=-DKVZ_STATIC_LIB --enable-nonfree --extra-cflags=-DAL_LIBTYPE_STATIC --extra-cflags='-IC:/ffmpeg/local64/include' --extra-cflags='-IC:/ffmpeg/local64/include/AL'
  libavutil      59. 28.100 / 59. 28.100
  libavcodec     61. 10.100 / 61. 10.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100
Input #0, matroska,webm, from 'out.mkv':
  Metadata:
    title           : COURAGE THE COWARDLY DOG SEASON 1 DISC 1
    COMPATIBLE_BRANDS: isomiso2mp41
    MAJOR_BRAND     : isom
    MINOR_VERSION   : 512
    ENCODER         : Lavf61.5.101
  Duration: 00:01:14.58, start: 0.000000, bitrate: 6163 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 74.124000
      Metadata:
        title           : Chapter 02
  Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, smpte170m/smpte170m/bt709), 1456x1080 [SAR 270:271 DAR 364:271], 23.98 fps, 23.98 tbr, 1k tbn (default)
      Metadata:
        HANDLER_NAME    : VideoHandler
        VENDOR_ID       : [0][0][0][0]
        DURATION        : 00:01:14.575000000
  Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1080x1328 [SAR 1:1 DAR 135:166], 30k fps, 1k tbr, 1k tbn
      Metadata:
        DURATION        : 00:00:00.000000000
  Stream #0:2(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
      Metadata:
        HANDLER_NAME    : SoundHandler
        VENDOR_ID       : [0][0][0][0]
        DURATION        : 00:01:14.560000000
On another note, matroska doesn't record the bitrate of each stream when it's encoded so if you try to measure and save it as a tag, you end up with misleading metadata.
 
Last edited:
  • Thunk-Provoking
Reactions: Belisarius Cawl
Any chance I could get access to the original media?
The file itself is just a sample I made to test a python script I'm writing hence the thumbnail mismatch with the content. P.S., I'll delete this after some hours because it's 54 MB.
 
  • Informative
Reactions: N Space
Last edited:
  • Feels
Reactions: Belisarius Cawl
Does anyone use Emacs and ledger-mode for personal accounting? The other option is GNU Cash. I'd really like to automate a script to pull from my bank accounts/credit cards and have this data available to me in plain text, with less manual grunt work. In the old days we'd have to sit down every month with a calculator and learn to balance the checkbook. This might be more important than making spinning triangles and sine waves.
 
Back