4 ms·
> need a shared filesystem for this to work Oh oof. I thought removing that requirement would be the whole point of something named "FFmpeg-over-IP". Shared fi
by NavinF 2y ago
> need a shared filesystem for this to work
Oh oof. I thought removing that requirement would be the whole point of something named "FFmpeg-over-IP". Shared filesystem usually involves full trust between machines, bad network error handling, and setting things up by hand (different config on every distro)
- steelbrain 2y agoI hear you. If your usecase doesn't require live streaming of converted file, a sibling comment may fit the usecase: https://news.ycombinator.com/item?id=41745593 https://news.ycombinator.com/item?id=41745593
- NavinF 2y agoAh unfortunately my use case is similar to yours: Use Windows desktop to transcode files stored on a Linux NAS. My files are ~100GB so encoding multiple files in parallel would waste a lot of space and unnecessarily burn write cycles
- steelbrain 2y agoFWIW, you can run an smb server from within a docker container (on the linux side). I forget which one I used but it makes the setup painless and you can configure different auth strategies as well. Network errors (little bit of packet loss) are generally handled by the underlying OS, and in case of windows, it can use multiple network paths simultaneously to give you the aggregate bandwidth.
- linuxdude314 2y agoYou typically don’t even have to go to that length. This is usually supported out of the box. No idea what problem this is trying to solve. Just seems like the user wasn’t familiar enough with how to use a NAS.
- oefrha 2y agoMore like you’re not familiar enough with the video encoding performance of a typical NAS that is not in the thousand dollar range. Or what’s a NAS — it can be anything really.
- linuxdude314 2y agoWhy would you transcode on the NAS? Not what I’m suggesting at all; perf on most NAS is awful for that… There’s a pretty well understood concept of what a NAS is; this isn’t a complicated philosophical problem. A very common workflow in motion picture production is to use NAS for storage on a fast network, mount the SMB share, have a script/tool/app that monitors the ingest directory and writes to an output dir. FWIW the key differentiator between a NAS and other types of network storage is the protocols they use. If files is the main primitive, it’s a NAS; it’s its blocks it’s considered a SAN. Sometimes SANs have NAS “heads” for clients that want file access or a block level storage device.
- otterley 2y agoMy five-year-old Synology DS418play has support for hardware realtime transcoding via its integrated low-power GPU. I think I paid about $600 for it. You can get a new DS423+ for about the same price.
- NavinF 2y agoThat only works if your output codec is something really old like H264
- otterley 2y agoWhat's the point of transcoding to HEVC? If your playback device already supports it, and the file is already HEVC, then there's no need to transcode. And there's no benefit I'm aware of in transcoding from an older format like H.264 to HEVC. AFAIK, every device that supports HEVC media also supports H.264 as well. It would be helpful to understand your specific use cases in more detail, particularly for batch transcoding (my understanding is that this solution is not about stream transcoding).
- deleted 2y ago[deleted]
- qwertox 2y agoOne could write a small Python server in one day which receives a chunked POST request and transcodes the video on the fly. The same server could also offer a download link for the transcoded video, and also receive URL parameters for the transcoding options. Or the transcoded video itself is returned after the subprocess finishes. Something along the lines of: Server import asyncio import subprocess from aiohttp import web async def transcode_video(request): cmd = [ "ffmpeg", "-i", "pipe:0", "-f", "mp4", "-preset", "fast", "output_file.mp4" ] process = await asyncio.create_subprocess_exec( *cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) async for chunk in request.content.iter_any(): process.stdin.write(chunk) await process.stdin.drain() await process.stdin.close() await process.wait() return web.Response(text="Video transcoded successfully!") app = web.Application() app.router.add_post('/upload', transcode_video) if __name__ == '__main__': web.run_app(app, port=8080) Client curl -X POST http://<server_ip>:8080/upload \ --header "Content-Type: application/octet-stream" \ --data-binary @video.mp4 This way no shared filesystem is required.
- steelbrain 2y agoThis and the other solutions in this thread wont work with plex or the media servers. The way it works with the media servers is that there’s a variable number of outputs, and you just cant emulate that on the client side without a virtual filesystem or by some creative hacks that use multiple file descriptors (even then how do you handle dynamic?). As for why the variable number of outputs exist in the first place, it’s because when you’re a media server, you dont want to wait until the full file is converted before serving it to the user. You want to start playing immediately so the output is chunked into multiple files
- yarg 2y agoCouldn't you create and share a virtual file system with FUSE?
- yjftsjthsd-h 2y agoLike SSHFS, or something custom? And how much does that help with any of those concerns?
- yarg 2y agoThe primary concern is trust/security. User space limits potential security impacts, and a restricted VFS could be used to prevent clients from accessing anything that they shouldn't. (Although I'm not even pretending to know whether or not this is a remotely good idea - my guess is that it isn't, but I'd like to know just how bad an idea it actually is.)
- NavinF 2y agoMounting anything requires root even if you use FUSE. There are ways to intercept writes without root and send them to another machine. Eg you could use LD_PRELOAD. But that's exactly the kind of pain in the ass that I was hoping a project named FFmpeg-over-IP would automate.
- duped 2y agomount doesn't require root, but even without getting into mount namespaces, this is why fusermount3 exists