scan Mediakey for displaying Dreamcatcher Capsule

This commit is contained in:
fred 2022-07-03 21:41:04 +02:00
parent c03e59ec5f
commit 49760cb10d
3 changed files with 3456 additions and 19 deletions

3421
templates/dreamcatcher.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -7,17 +7,8 @@ ME="${0##*/}"
MOATS=$(date -u +"%Y%m%d%H%M%S%4N")
IPFSNODEID=$(cat ~/.ipfs/config | jq -r .Identity.PeerID)
instascan=$(ps auxf --sort=+utime | grep -w nc | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $instascan ]] && echo "already running" && exit 1
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 )
QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 )
qrscan=$(ps auxf --sort=+utime | grep -w qrscan_login.sh | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1)
[[ $qrscan ]] && echo "qrscan already running" && exit 1
# Check if Astroport Station already has a "captain"
source ~/.zen/ipfs.sync; echo "Le capitaine de cet Astroport est actuellement $CAPTAIN"
@ -33,12 +24,26 @@ cat /dev/ttyACM0 | while read line; do
## FORCE LOCAL USE ONLY. Remove to open 1234 API
[[ ! -d ~/.zen/game/players/$PLAYER || $PLAYER == "" ]] && echo "AUCUN PLAYER !!" && exit 1
espeak "Astronaute $PSEUDO. Welcome!"
## LOGIN
rm -f ~/.zen/game/players/.current
ln -s ~/.zen/game/players/$PLAYER ~/.zen/game/players/.current
# Check who is .current PLAYER
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( echo "noplayer" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( echo "nopseudo" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( echo "nog1pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( echo "noipfsnodeid" && exit 1 )
PLAYERNS=$(cat ~/.zen/game/players/.current/.playerns 2>/dev/null) || ( echo "noplayerns" && exit 1 )
MOANS=$(cat ~/.zen/game/players/.current/.moans 2>/dev/null) || ( echo "noplayermoans" && exit 1 )
QOOPNS=$(cat ~/.zen/game/players/.current/.qoopns 2>/dev/null) || ( echo "noplayerqoopns" && exit 1 )
espeak "Opening your TW5"
~/.zen/Astroport.ONE/tools/PLAYER.entrance.sh ## Switch IPFS Layer with Astronaut ID & astrXbian data index structure
espeak "Report your best dreams and plans to the astroport captain. Love."
break
done

View File

@ -30,6 +30,8 @@ mkdir -p ~/.zen/tmp/
#[[ $desktop != "" ]] && screencapture
PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null) || ( espeak "no player. EXIT" && exit 1 )
PSEUDO=$(cat ~/.zen/game/players/.current/.pseudo 2>/dev/null) || ( espeak "no pseudo. EXIT" && exit 1 )
G1PUB=$(cat ~/.zen/game/players/.current/.g1pub 2>/dev/null) || ( espeak "no g1 pub" && exit 1 )
IPFSNODEID=$(cat ~/.zen/game/players/.current/.ipfsnodeid 2>/dev/null) || ( espeak "no ipfs node id" && exit 1 )
espeak "$PSEUDO"
sleep 1
@ -61,7 +63,7 @@ echo "NEW VIDEO FILE /ipfs/$IPFSID/output.mp4"
espeak "OK"
mkdir -p ~/.zen/game/players/.current/publish
mkdir -p ~/.zen/game/players/.current/vlog
## Creating new video chain index.html
OLDID=$(cat ~/.zen/game/players/.current/.vlog.index 2>/dev/null)
@ -72,23 +74,32 @@ else
sed s/_IPFSID_/$IPFSID/g ${MY_PATH}/../templates/video_first.html > /tmp/index.html
fi
sed -i s/_DATE_/$(date -u "+%Y-%m-%d#%H:%M:%S")/g /tmp/index.html
sed s/_PSEUDO_/$PLAYER/g /tmp/index.html > ~/.zen/game/players/.current/publish/index.html
sed s/_PSEUDO_/$PLAYER/g /tmp/index.html > ~/.zen/game/players/.current/vlog/index.html
# Copy style & js
cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/.current/publish/
cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/.current/publish/
cp -R ${MY_PATH}/../templates/styles ~/.zen/game/players/.current/vlog/
cp -R ${MY_PATH}/../templates/js ~/.zen/game/players/.current/vlog/
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/publish | tail -n 1)
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/vlog | tail -n 1)
echo $IPFSROOT > ~/.zen/game/players/.current/.vlog.index
# Change CSS path to
sed s/_IPFSROOT_/$IPFSROOT/g /tmp/index.html > ~/.zen/game/players/.current/publish/index.html
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/publish | tail -n 1)
sed s/_IPFSROOT_/$IPFSROOT/g /tmp/index.html > ~/.zen/game/players/.current/vlog/index.html
IPFSROOT=$(ipfs add -rHq ~/.zen/game/players/.current/vlog | tail -n 1)
echo "NEW VIDEO http://127.0.0.1:8080/ipfs/$IPFSROOT"
## OUVERTURE VLOG CHAIN
xdg-open "http://127.0.0.1:8080/ipfs/$IPFSROOT"
## AJOUT VIDEO ASTROPORT
MEDIAID="$(date -u +%s%N | cut -b1-13)"
mkdir -p ~/astroport/video/${MEDIAID}/
MEDIAKEY="VIDEO_${MEDIAID}"
cp ~/.zen/tmp/output.mp4 ~/astroport/video/${MEDIAID}/
~/.zen/astrXbian/zen/new_file_in_astroport.sh "$HOME/astroport/video/${MEDIAID}/" "output.mp4" "$G1PUB"
# https://stackoverflow.com/questions/49846400/raspberry-pi-use-vlc-to-stream-webcam-logitech-c920-h264-video-without-tran
# record to MKV cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=file,mux=mkv,dst='~/.zen/tmp/Webcam_Record/MyVid.mkv'}'
# record to MP4 cvlc v4l2:///dev/video0:chroma=h264 :input-slave=alsa://hw:1,0 --sout '#transcode{acodec=mpga,ab=128,channels=2,samplerate=44100,threads=4,audio-sync=1}:standard{access=file,mux=mp4,dst='~/.zen/tmp/Webcam_Record/MyVid.mp4'}'