Interests: programming, video games, anime, music composition

I used to be on kbin as e0qdk@kbin.social before it broke down.

  • 0 Posts
  • 17 Comments
Joined 1 year ago
cake
Cake day: November 27th, 2023

help-circle

  • I’ve tried setting up projects that used hard links like that and there are some pros and cons to this. On the plus side, you can delete from one location and the file is still available in the other without having to manage a separate repository structure. On the down side, most software cannot copy the structure correctly to a different file system (even one that supports hard links), which can make backups and migrations annoying to deal with – generally you end up with multiple actual copies, ballooning disk space usage and sometimes causing weird issues if the two files linking to the same data (rather than just having copies of the same data) actually matters…

    I’d recommend sticking with the “primary repository of real files” and “multiple views filled with symlinks” structure over hardlinks unless you’re really sure you know what you’re getting yourself into.





  • Two quick ideas on possible approaches:

    1. Static page route. You can just write some Javascript to load the image from a file input in HTML, draw it resized to a canvas (based on an input slider or other input element), then save the canvas to an image. (There might even be simpler approaches if I wasn’t stupidly tired right now…) This can be done in a single file (HTML with embedded JS – and CSS if you want to style it a little) that you toss on any web server anywhere (e.g. Apache, nginx, whatever). Should work for JPEG, PNG, and probably WebP – maybe other regular image types too. Benefit: data never needs to leave your device.

    2. Process on server route. Use Python with a simple web server library (I usually opt for tornado for stuff like this, but flask or cherrypy or similar would probably work). Set up a handler for e.g. an HTTP POST and either pass the image into a library like Pillow to resize it or shell out to ImageMagick as others have suggested. (If you want to do something clever with animated GIFs you could shell out to ffmpeg, but that’d be a fair bit trickier…) The image can be sent back as the response. Be careful about security if you take this route. Probably want some kind of login in front of it, and run it in a VM or some other secure environment – especially if you’re using AI to kludge it together…

    Best of luck and let me know if you need any help. Will probably have some time this weekend if you can’t get it on your own. Happy hacking!


  • I would be happy with a FOSS desktop app I can install in linux too

    On the command line, you can do this with ImageMagick (e.g. use the command convert once it’s installed).

    With a (desktop) GUI, there’s a bunch of programs. GIMP is probably the most well known and has a ton of capabilities but is a bit complex. I use Kolourpaint as a quick-and-dirty “MS Paint”-like program for very simple tasks where I want a GUI.

    If you want a simple web UI I’m sure there is one already, but I don’t know one specifically. It wouldn’t be too complicated to hack something up if all you need is a quick-and-dirty file input and percentage rescale or something like that. If you don’t get a better suggestion and don’t know how to make something like that yourself, let me know and I can write an example.


  • People have already covered most of the tools I typically use, but one I haven’t seen listed yet that is sometimes convenient is python3 -m http.server which runs a small web server that shares whatever is in the directory you launched it from. I’ve used that to download files onto my phone before when I didn’t have the right USB cables/adapters handy as well as for getting data out of VMs when I didn’t want to bother setting up something more complex.


  • e0qdk@reddthat.comtoFediverse@lemmy.worldKarma in lemmy?
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 month ago

    I’m under the impression the reputation points are either the combined number of upvotes or that minus downvotes

    IIRC from kbin – and assuming mbin didn’t change things – boosts counted for two points while upvotes (favorites) are one point and downvotes (reduces) are one point. Boosts are basically retweets, IIRC, and wouldn’t be coming from lemmy users – just from Mastodon, mbin, and other tools that support it.

    Edit: To clarify, I mean downvotes reduce by one point.







  • As someone who watches gaming footage on PeerTube, I’ve mostly interacted with single creator instances – i.e. either the creator themselves is self-hosting it or it’s run by a fan as a non-YT backup of their Twitch/Owncast/whatever VODs. Those instances generally do not allow anyone else to upload.

    Discoverability sucks but the way I’ve found them is by using SepiaSearch and looking for specific words from game titles. I imagine the way most other people find them is that they already know the content creator from Twitch and want to find an old VOD that isn’t archived on YT (e.g. because of YT’s bullshit copyright system) – but that’s just a guess.


  • It’s surprising that there doesn’t seem to be an obvious way in the UI to just see a list of creators/channels on a local instance. So, that’s the first thing I’d change to improve discoverability.

    The way I currently find relevant content is by going to Sepia Search, putting in exact words that I think are likely to be in the title of at least one video on a channel that would likely also have a lot of other relevant content, and then going through that channel’s playlists. Those searches often lead me to single user instances with only one or two channels (e.g. a channel that has a backup of that user’s YouTube content and a channel with a backup of their Twitch or OwnCast or whatever streams). When it leads me to a generalist instance or one with a relevant subject/theme though, I’ve had little luck finding content from anyone else unless they’ve posted recently (compared to other users). Often the content that is most relevant to me is not what is newest but the archives from years ago. (New content is relevant though once I want to follow someone in particular, but it’s not what I want to see first.)

    Another issue I’ve encountered is with the behavior of downloaded videos. I greatly appreciate that PeerTube provides a URL for direct download, and I prefer to watch videos in my own player downloaded in advance (so I can watch offline; pause and resume trivially after putting my computer to sleep; etc). H264 MP4 works fine for this, but the download seems to be some sort of chunked variant of it (for HLS?) which requires the player to read in the entire file to figure out the length or seek accurately. Having to wait a minute or two to be able to seek each time I open a large video file off my HDD is an irritating papercut. I suspect there’s likely a way to fix it by including an index in the file (or in a sidecar file) but I don’t know how to do it – short of re-encoding the entire video again which I’d rather not do since it both takes a long time and can result in quality loss. (EDIT ffmpeg -i input.mp4 -vcodec copy -acodec copy -movflags faststart output.mp4 repacks the video quickly.) This usually doesn’t affect newly added videos (where the download link includes the pattern /download/web-videos and a warning is shown that it’s still being transcoded) but does when that’s done (the URL includes /download/streaming-playlists/hls/videos instead); so, this is something that happens as a result of PeerTube’s reprocessing.

    Downloads from the instances that I’ve found to be most relevant to me are also pretty unreliable (connection is slow and drops a lot), so I use wget with automatic retries (and it sometimes still needs manual retries…) rather than downloading through my browser which tends to fail and then often annoyingly start over completely if I request a retry… It would be really nice if I could check that I’ve downloaded the file correctly and completely with a sha256 hash or something.