also ich muss es so machen wie ich gesagt habe ^^
habe hier den code wo ich ein bischen am rumspielen bin vll. kann mir da wer weiterhelfen
die cgi:
Code:
#!/bin/bash
echo -ne 'content-type: text/html\n\n'
# HTML-Header
echo '<html><head>'
#echo '<script src="jquery-1.11.3.min.js"></script>'
#echo '<script src="script.js"></script>'
echo '</head><body bgcolor=black text=white>'
#read querystring
#echo "QS: $QUERY_STRING <br>"
#echo "stdin: $querystring <br>"
#if [ $querystring != "" ] ; then
#ffmpeg -i rtsp://admin:9999@192.168.10.135:554/onvif/profile2/media.smp -f image2 /home/pi/testimg.jpg
#echo 'hallo'
#fi
#echo '<button type="button">Click Me!</button>'
#echo '<button type="button" id="bildmachen">Bild machen</button>'
#ffmpeg -i rtsp://admin:9999@192.168.10.135:554/onvif/profile2/media.smp -f image2 /home/pi/testimg.jpg
ffmpeg -i rtsp://admin:9999@192.168.1.13:554/onvif/profile2/media.smp -f image2 /var/www/kamera/testimg.jpg
echo '<img src="/kamera/testimg.jpg" width="1080" height="720" alt="Bild">'
echo '<button type="button" onclick="<?php
echo exec('ffmpeg -i rtsp://admin:9999@192.168.1.13:554/onvif/profile2/media.smp -f image2 /var/www/kamera/testimg.jpg');
?>
">test</button>'
echo '</body></html>'
und das javascript:
Code:
$( document ).ready (function() {
console.log( "ready!" );
$('#bildmachen').click (function() {
console.log( "click");
var jqxhr = $.post( "hallo.cgi", function() {
command: "ffmpeg -i rtsp://217.146.95.166:554/playlist/ch27yqcif.3gp -f image2 /home/pi/testimg.jpg"
console.log( "success");
})
.done(function() {
console.log( "second success" );
})
.fail(function() {
console.log( "error" );
})
.always(function() {
console.log( "finished" );
})
});
});