My use-case: streaming video to a Linux virtual mount and want compression of said video files on the fly.

Rclone has an experimental remote for compression but this stuff is important to me so that’s no good. I know rsync can do it but will it work for video files, and how I get rsync to warch the virtual mount-point and automatically compress and move over each individual file to rclone for upload to the Cloud? This is mostly to save on upload bandwidth and storage costs.

Thanks!

  • WIPocket@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    ·
    1 month ago

    What is the format of these videos? Im afraid you wont get much compression out of conventional file compressors, as video files are usually already compressed to the point where you would have to reencode them to get a smaller file.

  • Björn Tantau@swg-empire.de
    link
    fedilink
    English
    arrow-up
    9
    ·
    1 month ago

    What is your end goal? Do you want to back up your videos with minimal storage costs? Compression won’t help you (because videos are already compressed) unless you can accept data loss through re-encoding. Handbrake (or pure ffmpeg) would be the tool to re-encode lots of files. This could save you space but you may have some loss of quality, depending on the configuration you use and how the original videos are encoded.

    If you just want the videos to be available for streaming, tools like Jellyfin or Emby would do the job. They are servers that re-encode your media for streaming on the fly, depending on the client capabilities and your bandwidth settings.

  • Sims@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 month ago

    Not much help, but a quick search revealed this: https://github.com/nschlia/ffmpegfs

    This seemed to be read-only tho, so not sure if it covers the use case you described. If you can program a little (AI help?) find a simple fuse filesystem in a language you know, fiddle with it and call ffmpeg or similar on receiving files.

  • michaelmrose@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    1 month ago

    Already compressed files like video don’t meaningfully compress more. Compression isn’t magic.

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 month ago

    https://github.com/bcopeland/gstfs

    If you want to do it at the filesystem level, which is what it sounds like you’re asking for, it sounds like this could do it. I have not used it.

    If you want to just watch a local directory or directory tree for a file being closed (like, the stream is complete) and then run a command on it (like, to compress and upload it), it sounds like you could use inotifywait with the close_write event.

  • 𝒎𝒂𝒏𝒊𝒆𝒍@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    as the rest said lossless compression won’t really work on media files as they’re already compressed, there are probably some compression layers based on fuse you could mount over your cloud storage mount point (if it supports mounting in linux) and it’d be transparent, but in case of video files i believe your only solution is to reencode those files, handbrake is a nice GUI tool

  • TheHolm
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    Do you plan to compress video ( which generally already compressed format) when saving to remote location? I do not see use case for it, as you ether use lossless compression and not compressing it in any meaningful way, or just re-encode to different format and loose quality. Second option is simpler to achieve by re-encoding before sending out.

  • slazer2au@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    This sounds stupid but what about tdarr?

    Stash the file in a staging directory that tdarr watches, have tdarr convert the file to something small like h265. Output the converted file to a folder rsync watches.

  • 9point6@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    Unless you’ve got raw uncompressed video, any kind of transparent compression like you describe is only going to cost you in energy bills for no benefit. Most video is already compressed with specialised video compression as part of the file format, you can’t keep compressing stuff and getting smaller files.

    The alternative is a lossy compression, which you could automate with some scripts or a transcoding tool like tdarr. This would reduce the quality of the video in order to reduce the file size