Score:0

How to play on local in MPV camera AV output from remote via SSH?

ss flag

I need simple thing, play on local in MPV camera AV output from remote via SSH.

I thought it should be simple like this.

ssh 192.168.1.100 -p 22 'ffmpeg -i /dev/video0 -b:v 1M -b:a 150K -' | mpv -

But it fails.

Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 2740.580412, bitrate: 147456 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[NULL @ 0x555639eb3480] Unable to find a suitable output format for 'pipe:'
pipe:: Invalid argument
Failed to recognize file format.


Exiting... (Errors when loading file)

What is wrong?

Thanks.

Score:2
jp flag

You need to tell ffmpeg which output container format / muxer (-f) to use when using a pipe:

ssh -p 22 192.168.1.100 'ffmpeg -i /dev/video0 -c:v libx264 -c:a aac -b:v 1M -b:a 150k -f mpegts -' | mpv -
genderbee avatar
ss flag
Perfect, thank you. It shows me some fails, but it is working. Maybe just for info, what does it mean? `[ffmpeg] AVHWDeviceContext: Failed to query surface attributes: 20 (the requested function is not implemented). [vo/gpu/vaapi-egl] failed to retrieve libavutil frame constraints `
llogan avatar
jp flag
@genderbee Never seen that before. Must be from `mpv` which I am not as familiar with.
genderbee avatar
ss flag
And sound is not working, but it is related to audio interface on remote? Thanks.
llogan avatar
jp flag
@genderbee Your input (from what I can tell from your partial ffmpeg console output) does not contain any sound.
genderbee avatar
ss flag
This is not audio identification? `-c:a aac` `-b:a 150k` What I need to add?
llogan avatar
jp flag
@genderbee You have to add an input that has audio. ffmpeg shows that your camera does not provide any audio. `-c:a aac` sets the audio encoder and `-b:a 150k` sets the audio bitrate, but they are ignored if you do not have any audio inputs.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.