1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/bash
- #IMG=$(cd /ramfs; find ./ -type f -name *.jpg -exec readlink -f {} \;)
- #IMG=$(ls -t /home/pi/_Pictures | head -1)
- while [[ ! -f /ramfs/.canbeconvert ]]; do
- sleep 1
- echo "wait for file to convert..."
- done
- IMG=$(cat /ramfs/.canbeconvert)
- echo "=> File $IMG detected !"
- #############
- # Mode SSTV
- while [[ -f "/ramfs/totx.wav" ]]; do
- echo "=> Skipping convert, because old one is not yet Txed !"
- sleep 5
- done
- # On traite l'image...
- echo "=> Copying picz in RAMFS"
- cp -r /home/pi/_Pictures/$IMG /ramfs/$IMG
- echo "=> Converting to PD120 Format <long>x496"
- convert /ramfs/$IMG -resize 660x496^ /ramfs/lit-$IMG
- rm -rf /ramfs/$IMG
- echo "=> Adding annotaion"
- mogrify -format 'jpg' -font Liberation-Sans -fill white -undercolor '#00000080' -pointsize 26 -gravity NorthEast -annotate +10+10 " $(date) - F4KMH - 73 :o) " /ramfs/lit-$IMG
- echo " => Converting image to WAV..."
- cd ~/PySSTV/
- source bin/activate
- python -m pysstv --mode PD120 --rate 44100 --bits 16 --vox --fskid "F4IYQ" /ramfs/lit-$IMG /ramfs/totx.wav
- deactivate
- echo "=> Setting flag that can be Tx"
- touch /ramfs/.canbetx
- rm -rf /ramfs/lit-$IMG
- echo -n ""
|