Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on piefed.blahaj.zone

[solved] [ffmpeg/mpv] How to set up a stream over LAN?

Edit: I ended up piping ffmpeg into ssh to which through single quotes (or the -t switch, according to the manual) I gave the MPV command. I also needed to encode the streams, because either the layer one infrastructure couldn't handle the transmission or the receiving/playing computer couldn't decode fast enough (an old T480). Thank you @[email protected] ! The only thing I missed was that I had never actually ssh:ed into this particular computer, so the command got caught up in weird... "Situations" haha. Enabling public key authentication solved that. The final resulting command:

ffmpeg -f v4l2 -i [my video card] -f alsa -i [my sound card] -c:v libx264 -crf 18 -preset superfast -c:a flac -f nut pipe:1 | ssh -p [port] username@otherhost 'mpv [a buttload of options] -'  

I am watching VHS tapes with ffmpeg and piping it into MPV with ffmpeg -f v4l2 -i [my video card] -f alsa -i [my sound card] -c copy -f nut pipe:1 | mpv -. The reason I'm not just playing the video and audio stream off of my capture device is because I want to be able to adjust audio delay in real time with MPV hotkeys. This works well so far. Now, I want to grab the stream from another computer on my LAN. How do I do that? I've been thinking of sshfs, but I can't mount the capture card. Should I stream into a file on the server which I then mount on the client side with sshfs? If I did that, I'd have to delete the file that my command created every time I watched something, no?

View original on piefed.blahaj.zone
36

7 replies

If you want another "unga-bunga" approach, you can use netcat:
On the player machine:

nc -l 1234 | mpv -

On the sender machine:

ffmpeg | nc 192.168.1.4 1234

Of course, you can use any unused port instead of 1234.

15
lemmy.world

Realistically, you'll probably want to encode the stream first to keep bandwidth sane, but I suspect you're looking for something like: ffmpeg -f v4l2 -i [my video card] -f alsa -i [my sound card] -c copy -f nut pipe:1 | ssh username@otherhost 'mpv -'.

17

Maybe you should be looking into a proper RTSP video stream. I know VLC can act as a server.

4

You reached the end

[solved] [ffmpeg/mpv] How to set up a stream over LAN? | Spyke