guinuxbr / KDEConnect-commands

List of examples to be used in KDE Connect.
59 stars 13 forks source link

Webcam to phone command not working #1

Closed sachinpandeyatd closed 2 years ago

sachinpandeyatd commented 2 years ago

When I ran this command it only opened my laptop's camera, but neither captured any pic nor sent to the phone. Also, I had to close it from the "system activity", because it was not closing itself.

guinuxbr commented 2 years ago

Hi @sachinpandeyatd. It looks like the FFmpeg options changed. Try this: file="$HOME/Pictures/WebcamImage$(date "+%Y%m%d%H%M%S").jpg"; ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 -frames:v 1 "${file}" && kdeconnect-cli -d $(kdeconnect-cli -a --id-only) --share "${file}"

sachinpandeyatd commented 2 years ago

Hi @sachinpandeyatd. It looks like the FFmpeg options changed. Try this: file="$HOME/Pictures/WebcamImage$(date "+%Y%m%d%H%M%S").jpg"; ffmpeg -f video4linux2 -input_format mjpeg -s 1280x720 -i /dev/video0 -frames:v 1 "${file}" && kdeconnect-cli -d $(kdeconnect-cli -a --id-only) --share "${file}"

It's perfectly working for me, Thank you very much!!!