tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit ded3a174029fea0cd1bfb6d0e3e626da536add1e
parent ae181746aff7312f77790527a1acc82cfb3bf4a8
Author: rbckman <robinbackman@gmail.com>
Date:   Thu, 16 Aug 2018 19:34:08 +0300

install script fixed, dropped frames fixes

Diffstat:
Minstall.sh | 30+++++++++++++++++-------------
Arandom/writefasterhack.sh | 7+++++++
Mtarina.py | 22+++++++++++++---------
3 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/install.sh b/install.sh @@ -14,37 +14,41 @@ rpi-update echo "installing python-omxplayer-wrapper..." pip install omxplayer-wrapper echo "changing cpu governor to performance..." -cat <<'EOF' >> /etc/default/cpufrequtils +cat <<'EOF' > /etc/default/cpufrequtils GOVERNOR="performance" EOF echo "Adding to /boot/config.txt" cp rpihdtft/dt-blob.bin /boot/ cat <<'EOF' >> /boot/config.txt #Rpi-hd-tft +dtoverlay=dpi18 +overscan_left=0 +overscan_right=0 +overscan_top=0 +overscan_bottom=0 framebuffer_width=800 framebuffer_height=480 -dtparam=spi=off -dtparam=i2c_arm=off enable_dpi_lcd=1 display_default_lcd=1 -dpi_output_format=0x6f015 dpi_group=2 dpi_mode=87 +dpi_output_format=0x6f015 hdmi_timings=480 0 16 16 24 800 0 4 2 2 0 0 0 60 0 32000000 6 -display_rotate=3 -dtoverlay=vga666 +display_rotate=3 +start_x=1 +gpu_mem=128 dtoverlay=pi3-disable-bt-overlay dtoverlay=i2c-gpio,i2c_gpio_scl=24,i2c_gpio_sda=23framebuffer_height=480 disable_splash=1 -#force_turbo=1 -#boot_delay=1 +force_turbo=1 +boot_delay=1 EOF echo "Change hostname to tarina" -cat <<'EOF' >> /etc/hostname +cat <<'EOF' > /etc/hostname tarina EOF -cat <<'EOF' >> /etc/hosts +cat <<'EOF' > /etc/hosts 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes @@ -57,8 +61,8 @@ echo "Adding to /boot/cmdline.txt" printf " consoleblank=0 logo.nologo loglevel=0 vt.global_cursor_default=0" >> /boot/cmdline.txt echo "USB soundcard to default" -echo "writing to /etc/modprobe.d/alsa-base.conf"; -cat <<'EOF' >> /etc/modprobe.d/alsa-base.conf +echo "writing to /etc/modprobe.d/alsa-base.conf" +cat <<'EOF' > /etc/modprobe.d/alsa-base.conf #set index value options snd_usb_audio index=0 options snd_bcm2835 index=1 @@ -68,7 +72,7 @@ EOF echo "Automatically boot to Tarina" echo "creating a tarina.service file" -echo <<'EOF' >> /etc/systemd/system/tarina.service +cat <<'EOF' > /etc/systemd/system/tarina.service [Unit] Description=tarina After=getty.target diff --git a/random/writefasterhack.sh b/random/writefasterhack.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo 3 >/proc/sys/vm/dirty_background_ratio +echo 50 >/proc/sys/vm/dirty_ratio +echo 300 >/proc/sys/vm/dirty_writeback_centisecs +echo 300 >/proc/sys/vm/dirty_expire_centisecs + diff --git a/tarina.py b/tarina.py @@ -935,6 +935,7 @@ def audiodelay(foldername, filename): os.system('sox /dev/shm/' + filename + '.wav ' + foldername + filename + '_temp.wav trim 0 -0.' + str(audiosync).zfill(3)) os.system('sox -G ' + foldername + filename + '_temp.wav ' + foldername + filename + '.wav fade 0.01 0 0.01') os.system('rm ' + foldername + filename + '_temp.wav ') + delayerr = 'A' + str(audiosync) else: #calculate difference audiosyncs = videos - audios @@ -947,7 +948,9 @@ def audiodelay(foldername, filename): #make the delay file os.system('sox -n -r 44100 -c 1 /dev/shm/silence.wav trim 0.0 ' + str(audiosyncs) + '.' + str(audiosyncms).zfill(3)) os.system('sox /dev/shm/' + filename + '.wav /dev/shm/silence.wav ' + foldername + filename + '.wav') + delayerr = 'V' + str(audiosyncms) os.system('rm /dev/shm/' + filename + '.wav') + return delayerr #os.system('mv audiosynced.wav ' + filename + '.wav') #os.system('rm silence.wav') @@ -1131,6 +1134,7 @@ def main(): buttonpressed = False holdbutton = '' updatethumb = False + delayerr = '' #Save settings every 5 seconds pausetime = time.time() @@ -1277,7 +1281,7 @@ def main(): os.system('mkdir -p ' + foldername) #camera.led = True os.system(tarinafolder + '/alsa-utils-1.0.25/aplay/arecord -D hw:0 -f S16_LE -c 1 -r 44100 -vv /dev/shm/' + filename + '.wav &') - camera.start_recording(foldername + filename + '.h264', format='h264', quality=20) + camera.start_recording(foldername + filename + '.h264', format='h264', quality=22) starttime = time.time() recording = True elif recording == True and float(time.time() - starttime) > 0.2: @@ -1297,7 +1301,7 @@ def main(): renderscene = True renderfilm = True compileshot(foldername + filename) - audiodelay(foldername,filename) + delayerr = audiodelay(foldername,filename) try: writemessage('Copying and syncing audio file...') #os.system('mv /dev/shm/' + filename + '.wav ' + foldername) @@ -1531,12 +1535,12 @@ def main(): #Jessie if debianversion > '8': os.system('amixer -c 0 sset Mic Playback ' + str(headphoneslevel) + '%') - elif menu[selected] == 'SCENE:': + elif menu[selected] == 'SCENE:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 0, 1) renderscene = True - elif menu[selected] == 'SHOT:': + elif menu[selected] == 'SHOT:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 1, 1) - elif menu[selected] == 'TAKE:': + elif menu[selected] == 'TAKE:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 2, 1) elif menu[selected] == 'RED:': camera.awb_mode = 'off' @@ -1609,12 +1613,12 @@ def main(): #Jessie if debianversion > '8': os.system('amixer -c 0 sset Mic Playback ' + str(headphoneslevel) + '%') - elif menu[selected] == 'SCENE:': + elif menu[selected] == 'SCENE:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 0, -1) renderscene = True - elif menu[selected] == 'SHOT:': + elif menu[selected] == 'SHOT:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 1, -1) - elif menu[selected] == 'TAKE:': + elif menu[selected] == 'TAKE:' and recording == False: scene, shot, take = browse2(filmname, filmfolder, scene, shot, take, 2, -1) elif menu[selected] == 'RED:': camera.awb_mode = 'off' @@ -1667,7 +1671,7 @@ def main(): camerared = str(float(camera.awb_gains[0]))[:4] camerablue = str(float(camera.awb_gains[1]))[:4] - settings = filmname, str(scene), str(shot), str(take), rectime, camerashutter, cameraiso, camerared, camerablue, str(camera.brightness), str(camera.contrast), str(camera.saturation), str(flip), str(beeps), str(reclenght), str(miclevel), str(headphoneslevel), diskleft, '', '', '', '', '', '', '' + settings = filmname, str(scene), str(shot), str(take), rectime, camerashutter, cameraiso, camerared, camerablue, str(camera.brightness), str(camera.contrast), str(camera.saturation), str(flip), str(beeps), str(reclenght), str(miclevel), str(headphoneslevel), diskleft + ' ' + delayerr, '', '', '', '', '', '', '' header='' #Check if menu is changed and save settings if pressed != '' or pressed != 'hold' or recording == True or rendermenu == True: