Tag: record

  • ffmpeg for recording from v4l2

    Every now and then some old VHS pops up after cleaning old storages, shelfes, workshops. And I am by far not a professional VHS digitizing service, but some VHS’s are really worth preserving to me, so I have a cheap VHS player and a Hauppauge USB-Live2 analogue USB capture device.

    A very simple way to capture the video and store it, would be:

    ffmpeg -f v4l2 -framerate 25 -i /dev/video0 -t 03:10:00 -f alsa -i plughw:2,0 -c:v libx264 -vf format=yuv420p -preset ultrafast -crf 23 -c:a aac -b:a 192k output2.mp4
    

    One could ofc adjust some parameters. In my case this was running on old hardware, where everything more CPU-bound than libx264 with the “ultrafast” preset would congest the CPU too much, leading to frame drops.

    The point here was also never to store in archive quality, for that I would need another VHS playback device with a TBC (Time Base Corrector) to decrease the horizontal jitter in the VHS, anyway. They are expensive. Or I would have to enter the whole new world of vhs-decode. Maybe one day.

  • Fun with regex: We match the requirements for the HTTPS DNS record type defined by RFC 9460

    To be able to fully read, understand and transfer RFCs into a standard-aligned application can be very difficult. You may become a lawyer as well.

    We start off with section 2.1 of RFC 9460 which defines the following rules for us to apply:

    • the record data must be formatted as “SvcPriority TargetName SvcParams” where
      • SvcPriority is a number between 0 and 65535
      • TargetName is a domain-name, which is a combination of texts (labels) that can contain alphabetic characters, digits and hyphens, these labels can be up to 63 characters each and can be bonded together using dots up to a length of 255 characters
        • Note: The domain-name is not specified in RFC 9460, but already in RFC 1035
      • SvcParam is one or more of either only a key such as ‘mykey’ or a key-value pair such as ‘mykey=”myvalue”‘ where the quotation mark is mandatory
    (more…)