rules/uv4l: Don't hard code raspicam script.

This commit is contained in:
Tiago Marques 2017-06-02 10:27:27 +01:00
parent eeefa5908d
commit db04cf06cb
2 changed files with 30 additions and 6 deletions

View File

@ -22,11 +22,6 @@ post_unpack()
{
mv "../etc" "../uv4l-$version/"
mv "../usr" "../uv4l-$version/"
touch startStreamRaspiCam.sh
echo "#!/bin/sh" >> startStreamRaspiCam.sh
echo "killall uv4l" >> startStreamRaspiCam.sh
echo "modprobe cuse" >> startStreamRaspiCam.sh
echo "uv4l -nopreview --auto-video_nr --driver raspicam --encoding h264 --width 1080 --height 720 --framerate 12 --quality 8 --server-option '--port=9090' --server-option '--max-queued-connections=30' --server-option '--max-streams=25' --server-option '--max-threads=29'" >> startStreamRaspiCam.sh
}
host_install()
@ -39,7 +34,8 @@ target_install()
{
$cmd_cp -r "usr/lib/"* "$cfg_dir_rootfs/usr/lib/"
$cmd_cp -r "usr/bin/"* "$cfg_dir_rootfs/usr/bin/"
$cmd_cp -r "startStreamRaspiCam.sh" "$cfg_dir_rootfs/usr/bin/"
tar -C "$pkg_dir/fs" -c -f - . | tar -C "$cfg_dir_rootfs" -x -v -f -
}

View File

@ -0,0 +1,28 @@
start()
{
killall uv4l
modprobe cuse &&
uv4l \
-nopreview \
--auto-video_nr \
--driver raspicam \
--encoding h264 \
--width 1080 \
--height 720 \
--framerate 20 \
--quality 10 \
--server-option \
--port=9090 \
--server-option \
--max-queued-connections=30 \
--server-option \
--max-streams=25 \
--server-option \
--max-threads=29
}
stop()
{
killall uv4l
rmmod uv4l
}