Skip to content
Snippets Groups Projects
raspi_screen.sh 514 B
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/bash
    
    # where to place the streams on disk. External USB drive recommended!
    cd streams/
    
    while true
    do
            FILE="stream"`date +%Y-%m-%d-%H-%M-%S`".mts"
    
            echo "Start streaming..."
            if nc -d 169.254.51.122 8888 >$FILE
            then
                    echo "Received stream. Start player..."
                    pkill -f omxplayer
                    ( time omxplayer --force-fps 25 $FILE ) &
            else
                    echo "Streaming failed. Retry later..."
                    sleep 1
            fi
    done