ການສາຍໜ້າຈໍ (Screencasting) ຈາກອຸປະກອນ Ubuntu touch ໄປຍັງຄອມພິວເຕີ¶
ຢູທິລິດຕີ້ command-line mirscreencast ທີ່ມາກັບເຄື່ອງ ຈະທຳການບັນທຶກເຟຣມໜ້າຈໍ (screen-frames) ລົງໃນໄຟລ໌. ໃຊ້ມັນເພື່ອສະຕຣີມ (stream) ໜ້າຈໍ Ubuntu Touch ຂອງທ່ານໄປຍັງຄອມພິວເຕີຜ່ານເຄືອຂ່າຍ (ຫຼື ຜ່ານ ADB ໂດຍກົງ) ເພື່ອເບິ່ງສົດ ຫຼື ບັນທຶກໄວ້ເປັນໄຟລ໌.
ການໃຊ້ ADB¶
You can catch output directly from the adb exec-out command and forward it to MPlayer:
adb exec-out timeout 120 mirscreencast -m /run/mir_socket --stdout --cap-interval 2 -s 384 640 | mplayer -demuxer rawvideo -rawvideo w=384:h=640:format=rgba -
timeout above is used to kill the process in a proper manner on the Ubuntu Touch device (120 seconds here).
(Otherwise the process continues even if killed on the computer.)
Reduce or increase the number of frames per second with``--cap-interval`` (1 = 60fps, 2=30fps, …)
and the size of frames 384 640 means a width of 384 px and a height of 640 px. If red and blue
colors look reversed you can use format=bgra instead of format=rbga
ຜ່ານເຄືອຂ່າຍ¶
ໃນສ່ວນຂອງຜູ້ຮັບ (receiver)¶
ສຳລັບການສາຍໜ້າຈໍແບບສົດໆ (real-time):
Prepare your computer to listen to a TCP port (1234 here) and forward the raw stream to a video player (MPlayer here) with a framesize of 384x640:
nc -l -p 1234 | gzip -dc | mplayer -demuxer rawvideo -rawvideo w=384:h=640:format=rgba -
ສຳລັບການບັນທຶກ stream:
Prepare your computer to listen to a TCP port (1234 here), unpack and forward the raw stream to a video encoder (MEncoder here):
nc -l -p 1234 | gzip -dc | mencoder -demuxer rawvideo -rawvideo fps=60:w=384:h=640:format=rgba -ovc x264 -o out.avi -
ໃນອຸປະກອນ Ubuntu Touch¶
Forward and gzip the stream with 60 FPS (--cap-interval 1) and a framesize of 384x640 to the computer at 10.42.0.209 on port 1234:
mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 384 640 | gzip -c | nc 10.42.0.209 1234
ສະຄຣິບຕົວຢ່າງ¶
Run this on a computer (with MPlayer installed and SSH access to the Ubuntu Touch device) to screencast a remote Ubuntu Touch device to it.:
#!/bin/bash
SCREEN_WIDTH=384
SCREEN_HEIGHT=640
PORT=1234
FORMAT=rgba
if [[ $# -eq 0 ]] ; then
echo 'usage: ./mircast.sh UT_IP_ADDRESS , e.g: ./mircast.sh 192.168.1.68'
exit 1
fi
IP=$1
LOCAL_COMMAND='nc -l -p $PORT | gzip -dc | mplayer -demuxer rawvideo -rawvideo w=$SCREEN_WIDTH:h=$SCREEN_HEIGHT:format=$FORMAT -'
REMOTE_COMMAND="mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s $SCREEN_WIDTH $SCREEN_HEIGHT | gzip -c | nc \$SSH_CLIENT $PORT"
ssh -f phablet@$IP "$REMOTE_COMMAND"
eval $LOCAL_COMMAND
ທ່ານສາມາດດາວໂຫຼດໄດ້ທີ່ນີ້: files/mircast.sh
ເອກະສານອ້າງອີງ¶
ແຫຼ່ງຂໍ້ມູນເລີ່ມຕົ້ນ: https://wiki.ubuntu.com/Touch/ScreenRecording
ວິດີໂອຕົວຢ່າງ: https://www.youtube.com/watch?v=HYm4RUwwo5Q