Refactor cam settings, add key bindings for wb, exp, flip image

This commit is contained in:
ABelliqueux 2024-11-01 09:22:54 +01:00
parent 3d13bd8905
commit b9a9f32e89
9 changed files with 155 additions and 376 deletions

View File

@ -1,6 +1,5 @@
[DEFAULT] [DEFAULT]
#camera_type = 2 cam_is_showmewebcam = true
cam_is_showmewebcam = false
use_date_for_folder = false use_date_for_folder = false
file_extension = 'png' file_extension = 'png'
projects_folder = '' projects_folder = ''
@ -10,9 +9,13 @@ fullscreen_bool = true
screen_w = 1920 screen_w = 1920
screen_h = 1080 screen_h = 1080
framerate = 16 framerate = 16
vflip = false
hflip = false
ffmpeg_path = '/usr/bin/ffmpeg' ffmpeg_path = '/usr/bin/ffmpeg'
export_options = 'scale=1920:-1,crop=1920:1080:0:102' export_options = 'scale=1920:-1,crop=1920:1080'
[CAMERA] [CAMERA]
cam_w = 1920
cam_h = 1080
vflip = 1
hflip = 1
auto_exposure = 0
white_balance_auto_preset = 0
video_bitrate=25000000

View File

@ -25,30 +25,34 @@ _ = gettext.translation('template', localedir='locales', languages=[LOCALE]).get
# Config # Config
# defaults # defaults
project_settings_defaults = { project_settings_defaults = {
# gphoto2 = 0, picam = 1, webcam = 2 'cam_is_showmewebcam': False,
'camera_type': 2,
'file_extension':'JPG',
'trigger_mode': 'key',
'projects_folder': '',
'use_date_for_folder': False, 'use_date_for_folder': False,
'file_extension':'png',
'projects_folder': '',
'onion_skin_onstartup' : False, 'onion_skin_onstartup' : False,
'onionskin_alpha_default' : 0.4, 'onionskin_alpha_default' : 0.4,
'onionskin_fx' : False,
'fullscreen_bool' : True, 'fullscreen_bool' : True,
'screen_w' : 1920, 'screen_w' : 1920,
'screen_h' : 1080, 'screen_h' : 1080,
'framerate' : 16, 'framerate' : 16,
'vflip' : False,
'hflip' : False,
'ffmpeg_path' : None, 'ffmpeg_path' : None,
'export_options' : 'scale=1920:-1,crop=1920:1080:0:102', 'export_options' : 'scale=1920:-1,crop=1920:1080:0:102',
'cache_images' : False,
'liveview' : False,
} }
camera_current_settings_defaults = {
'cam_w' : 800,
'cam_h' : 600,
'vflip' : 0,
'hflip' : 0,
'auto_exposure' : 0,
'white_balance_auto_preset' : 0,
}
# Load from file # Load from file
config_locations = ["./", "~/.", "~/.config/"] config_locations = ["./", "~/.", "~/.config/"]
config_found_msg = _("No configuration file found, using defaults.") config_found_msg = _("No configuration file found, using defaults.")
project_settings = project_settings_defaults project_settings = project_settings_defaults
camera_current_settings = camera_current_settings_defaults
for location in config_locations: for location in config_locations:
# Optional config files, ~ is expanded to $HOME on *nix, %USERPROFILE% on windows # Optional config files, ~ is expanded to $HOME on *nix, %USERPROFILE% on windows
if os.path.exists( os.path.expanduser(os.path.join(location, 'config.toml'))): if os.path.exists( os.path.expanduser(os.path.join(location, 'config.toml'))):
@ -61,13 +65,45 @@ for location in config_locations:
config_found_msg = _("Found configuration file in {}").format(os.path.expanduser(location)) config_found_msg = _("Found configuration file in {}").format(os.path.expanduser(location))
print(config_found_msg) print(config_found_msg)
def reset_wb_exp(): camera_current_settings = {
# Flip auto-exposure, white-balance on to adapt to light environment 'auto_exposure': dict(min=0, max=1, default=camera_settings['auto_exposure'], value=camera_settings['auto_exposure']),
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c auto_exposure=0 -c white_balance_auto_preset=1') 'white_balance_auto_preset': dict(min=0, max=9, default=camera_settings['white_balance_auto_preset'], value=camera_settings['white_balance_auto_preset']),
# Give some time to the captor to adapt 'horizontal_flip': dict(min=0, max=1, default=camera_settings['hflip'], value=camera_settings['hflip']),
time.sleep(1) 'vertical_flip': dict(min=0, max=1, default=camera_settings['vflip'], value=camera_settings['vflip']),
# Flip back, wb 3 = fluorescent 'video_bitrate': dict(min=25000000, max=25000000, default=camera_settings['video_bitrate'], value=camera_settings['video_bitrate']),
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c auto_exposure=1 -c white_balance_auto_preset=2') }
def apply_cam_setting(cam_settings:dict, to_set:list=None):
cmd = 'v4l2-ctl -d /dev/video0'
args = []
for setting in cam_settings:
if to_set is None:
# Apply defaults
cam_settings[setting]['value'] = cam_settings[setting]['default']
cmd += ' -c {}={}'
args.append(setting)
args.append(cam_settings[setting]['value'])
else:
# Increment settings in to_set
for setting in to_set:
if setting in cam_settings:
if cam_settings[setting]['value']+1 in range(cam_settings[setting]['min'],cam_settings[setting]['max']+1):
cam_settings[setting]['value'] += 1
else:
cam_settings[setting]['value'] = cam_settings[setting]['min']
cmd += ' -c {}={}'
args.append(setting)
args.append(cam_settings[setting]['value'])
else:
print(_("Unknown setting!"))
break
if project_settings['cam_is_showmewebcam']:
serialutils.send_serial_cmd(serialutils.find_cam_port(), cmd.format(*args))
else:
# TODO: v4l2 support
print(_("Camera function not supported."))
return cam_settings
def generate_text_image(text:str, screen_w, screen_h, bullets=False): def generate_text_image(text:str, screen_w, screen_h, bullets=False):
@ -75,8 +111,6 @@ def generate_text_image(text:str, screen_w, screen_h, bullets=False):
(screen_w, screen_h), (screen_w, screen_h),
(0,0,0) (0,0,0)
) )
# ~ text_image = np.zeros((screen_h,screen_w,3),np.uint8)
# ~ text_image_pil = Image.fromarray(text_image)
text_image_draw = ImageDraw.Draw(text_image) text_image_draw = ImageDraw.Draw(text_image)
if text is not None: if text is not None:
font = ImageFont.truetype("Tuffy_Bold.ttf", (screen_w/32)) font = ImageFont.truetype("Tuffy_Bold.ttf", (screen_w/32))
@ -251,8 +285,6 @@ def get_onionskin_frame(folder:str, index=None):
def return_next_frame_number(last_frame_name): def return_next_frame_number(last_frame_name):
prefix, filecount, ext = last_frame_name prefix, filecount, ext = last_frame_name
filename = '.{:04d}.'.format(int(filecount)+1) filename = '.{:04d}.'.format(int(filecount)+1)
# ~ filename = (".%04i." % x for x in count(int(filecount) + 1))
# ~ return prefix + next(filename) + ext
return prefix + filename + ext return prefix + filename + ext
@ -316,13 +348,9 @@ def batch_rename(folder:str):
# initialize counter to 0 # initialize counter to 0
frame_list = get_frames_list(folder) frame_list = get_frames_list(folder)
counter = (".%04i." % x for x in count(0)) counter = (".%04i." % x for x in count(0))
# ~ for i in range(len(frame_list)):
for i in frame_list: for i in frame_list:
# ~ if os.path.exists(os.path.realpath(frame_list[i])):
if os.path.exists(os.path.join(folder, i)): if os.path.exists(os.path.join(folder, i)):
# ~ os.rename(os.path.realpath(frame_list[i]), os.path.realpath("{}{}{}".format(project_settings['project_letter'], next(counter), project_settings['file_extension'])))
os.rename(os.path.join(folder, i), os.path.join(folder, "{}{}{}".format(project_letter, next(counter), project_settings['file_extension']))) os.rename(os.path.join(folder, i), os.path.join(folder, "{}{}{}".format(project_letter, next(counter), project_settings['file_extension'])))
# ~ print(os.path.join(folder, "{}{}{}".format(project_letter, next(counter), project_settings['file_extension'])))
else: else:
print(_("{} does not exist").format(str(i))) print(_("{} does not exist").format(str(i)))
return get_frames_list(folder) return get_frames_list(folder)
@ -350,8 +378,6 @@ def remove_frame(img_list, img_index):
send2trash(frame_path) send2trash(frame_path)
# remove entry from dict # remove entry from dict
img_list.remove(frame_name) img_list.remove(frame_name)
# offset cached images
# ~ offset_dictvalues(img_index)
# rename files and get new list # rename files and get new list
img_list = batch_rename(folder_path) img_list = batch_rename(folder_path)
clean_img_list(folder_path) clean_img_list(folder_path)
@ -377,7 +403,7 @@ def signal_handler(sig, frame):
ctrlc_pressed = True ctrlc_pressed = True
def parse_export_options(options:str, vflip:bool=False, hflip:bool=False): def parse_export_options(options:str, vflip:int=0, hflip:int=0):
if vflip: if vflip:
options += ',vflip' options += ',vflip'
if hflip: if hflip:
@ -404,94 +430,24 @@ def export_animation(input_filename, export_filename):
def main(args): def main(args):
global onionskin, playback, loop_playback, playhead, index, img_list, first_playback global onionskin, playback, loop_playback, playhead, index, img_list, first_playback, camera_current_settings
if not testDevice(0): if not testDevice(0):
print(_("No camera device found. Exiting...")) print(_("No camera device found. Exiting..."))
return 1 return 1
cam = cv2.VideoCapture(0) cam = cv2.VideoCapture(0)
# TODO : find highest def available and use that cam.set(cv2.CAP_PROP_FRAME_WIDTH, camera_settings['cam_w'])
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) cam.set(cv2.CAP_PROP_FRAME_HEIGHT, camera_settings['cam_h'])
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
frame = get_onionskin_frame(savepath, index) frame = get_onionskin_frame(savepath, index)
# TODO : (re)set camera settings on startup
# Using serial to send v4l2-ctl cmd to the camera
# Use v4l-ctl to flip frame
# v4l2-ctl -d /dev/video0 -c vertical_flip=1 -c control=value
# DEPRECATED : Using config file and loading with camera-ctl
# Write config file to /tmp/blah
# ~ write_config_file = '''rm /tmp/blah && echo "power_line_frequency=2
# ~ sharpness=50
# ~ video_bitrate=25000000
# ~ auto_exposure=1
# ~ auto_exposure_bias=2
# ~ white_balance_auto_preset=3
# ~ exposure_metering_mode=1
# ~ " > /tmp/blah'''
# Apply config
# ~ apply_config = '/opt/camera-control/camera-ctl -c /tmp/blah -v /dev/video0 -i repeat_sequence_header -i h264_i_frame_period -i h264_level -i h264_profile -i compression_quality\rl\rq\r'
# ~ serialutils.send_serial_cmd(serialutils.find_cam_port(), write_config_file)
# ~ serialutils.send_serial_cmd(serialutils.find_cam_port(), apply_config)
# ~ User Controls
# ~ brightness 0x00980900 (int) : min=0 max=100 step=1 default=50 value=50 flags=slider
# ~ contrast 0x00980901 (int) : min=-100 max=100 step=1 default=0 value=-2 flags=slider
# ~ saturation 0x00980902 (int) : min=-100 max=100 step=1 default=0 value=5 flags=slider
# ~ red_balance 0x0098090e (int) : min=1 max=7999 step=1 default=1000 value=1000 flags=slider
# ~ blue_balance 0x0098090f (int) : min=1 max=7999 step=1 default=1000 value=1000 flags=slider
# ~ horizontal_flip 0x00980914 (bool) : default=0 value=0
# ~ vertical_flip 0x00980915 (bool) : default=0 value=0
# ~ power_line_frequency 0x00980918 (menu) : min=0 max=3 default=1 value=1
# ~ sharpness 0x0098091b (int) : min=-100 max=100 step=1 default=0 value=10 flags=slider
# ~ color_effects 0x0098091f (menu) : min=0 max=15 default=0 value=0
# ~ rotate 0x00980922 (int) : min=0 max=360 step=90 default=0 value=0 flags=modify-layout
# ~ color_effects_cbcr 0x0098092a (int) : min=0 max=65535 step=1 default=32896 value=32896
# ~ Codec Controls
# ~ video_bitrate_mode 0x009909ce (menu) : min=0 max=1 default=0 value=0 flags=update
# ~ video_bitrate 0x009909cf (int) : min=25000 max=25000000 step=25000 default=10000000 value=25000000
# ~ repeat_sequence_header 0x009909e2 (bool) : default=0 value=0
# ~ h264_i_frame_period 0x00990a66 (int) : min=0 max=2147483647 step=1 default=60 value=60
# ~ h264_level 0x00990a67 (menu) : min=0 max=11 default=11 value=11
# ~ h264_profile 0x00990a6b (menu) : min=0 max=4 default=4 value=4
# ~ Camera Controls
# ~ auto_exposure 0x009a0901 (menu) : min=0 max=3 default=0 value=0
# ~ exposure_time_absolute 0x009a0902 (int) : min=1 max=10000 step=1 default=1000 value=1000
# ~ exposure_dynamic_framerate 0x009a0903 (bool) : default=0 value=0
# ~ auto_exposure_bias 0x009a0913 (intmenu): min=0 max=24 default=12 value=2
# ~ white_balance_auto_preset 0x009a0914 (menu) : min=0 max=9 default=1 value=1
# ~ image_stabilization 0x009a0916 (bool) : default=0 value=0
# ~ iso_sensitivity 0x009a0917 (intmenu): min=0 max=4 default=0 value=0
# ~ iso_sensitivity_auto 0x009a0918 (menu) : min=0 max=1 default=1 value=1
# ~ exposure_metering_mode 0x009a0919 (menu) : min=0 max=3 default=0 value=0
# ~ scene_mode 0x009a091a (menu) : min=0 max=13 default=0 value=0
# ~ JPEG Compression Controls
# ~ compression_quality 0x009d0903 (int) : min=1 max=100 step=1 default=30 value=30
if project_settings['cam_is_showmewebcam']: if project_settings['cam_is_showmewebcam']:
# Make sure we're using max bitrate # Apply config camera settings
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c video_bitrate=25000000') camera_current_settings = apply_cam_setting(camera_current_settings)
# Flip auto-exposure, white-balance on and off to adapt to light environment
reset_wb_exp()
# Flip preview (0 = vert; 1 = hor)
if project_settings['vflip']:
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c vertical_flip=1')
else:
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c vertical_flip=0')
if project_settings['hflip']:
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c horizontal_flip=1')
else:
serialutils.send_serial_cmd(serialutils.find_cam_port(), 'v4l2-ctl -d /dev/video0 -c horizontal_flip=0')
time.sleep(.5) time.sleep(.5)
loop_delta = 0 loop_delta = 0
while True: while True:
print(first_playback)
start = timer() start = timer()
if playback: if playback:
if onionskin: if onionskin:
@ -542,6 +498,15 @@ def main(args):
if (k%256 == 111) or (k%256 == 47): if (k%256 == 111) or (k%256 == 47):
# Toggle onionskin # Toggle onionskin
onionskin = not onionskin onionskin = not onionskin
# Key w - cycle wb
if (k%256 == 119):
camera_current_settings = apply_cam_setting(camera_current_settings, ['white_balance_auto_preset'])
# Key x - cycle exposure
if (k%256 == 120):
camera_current_settings = apply_cam_setting(camera_current_settings, ['auto_exposure'])
# Key f - flip image
if (k%256 == 102):
camera_current_settings = apply_cam_setting(camera_current_settings, ['vertical_flip','horizontal_flip'])
# Key up # Key up
elif (k%256 == 82) or (k%256 == 56): elif (k%256 == 82) or (k%256 == 56):
if len(img_list): if len(img_list):
@ -554,7 +519,6 @@ def main(args):
if playback: if playback:
playback = False playback = False
index, frame = first_frame(index) index, frame = first_frame(index)
print(index)
# Key left # Key left
elif (k%256 == 81) or (k%256 == 52): elif (k%256 == 81) or (k%256 == 52):
# Displau previous frame # Displau previous frame
@ -562,6 +526,7 @@ def main(args):
if playback: if playback:
playback = False playback = False
index, frame = previous_frame(index) index, frame = previous_frame(index)
# Key right
elif (k%256 == 83) or (k%256 == 54): elif (k%256 == 83) or (k%256 == 54):
# Displau next frame # Displau next frame
if len(img_list): if len(img_list):
@ -570,7 +535,9 @@ def main(args):
index, frame = next_frame(index) index, frame = next_frame(index)
# Key r / keypad 9 - reset wb,exp # Key r / keypad 9 - reset wb,exp
elif (k%256 == 114) or (k%256 == 57): elif (k%256 == 114) or (k%256 == 57):
reset_wb_exp() print(_("Reset camera settings"))
camera_current_settings = apply_cam_setting(camera_current_settings)
# ~ reset_wb_exp()
# Key e / keypad * # Key e / keypad *
elif (k%256 == 101) or (k%256 == 42): elif (k%256 == 101) or (k%256 == 42):
print(_("Export")) print(_("Export"))
@ -616,7 +583,6 @@ def main(args):
print(k) # else print its value print(k) # else print its value
end = timer() end = timer()
loop_delta = end - start loop_delta = end - start
print(loop_playback)
if 'ffmpeg_process' in locals(): if 'ffmpeg_process' in locals():
if ffmpeg_process.poll() is None: if ffmpeg_process.poll() is None:
@ -658,15 +624,13 @@ else:
project_letter = 'A' project_letter = 'A'
img_list = get_frames_list(savepath) img_list = get_frames_list(savepath)
index = len(img_list)-1 index = len(img_list)-1
print(project_letter)
# Export settings # Export settings
input_filename = "{folder}{sep}{letter}.%04d.{ext}".format(folder=savepath, sep=os.sep, letter=project_letter, ext=project_settings['file_extension']) input_filename = "{folder}{sep}{letter}.%04d.{ext}".format(folder=savepath, sep=os.sep, letter=project_letter, ext=project_settings['file_extension'])
print(input_filename)
input_options = ["image2", str(project_settings['framerate'])] input_options = ["image2", str(project_settings['framerate'])]
# ~ output_filename = "{folder}{sep}{filename}.mp4".format(folder=projects_folder, sep=os.sep, filename=savepath.split(os.sep)[-1]) # ~ output_filename = "{folder}{sep}{filename}.mp4".format(folder=projects_folder, sep=os.sep, filename=savepath.split(os.sep)[-1])
output_filename = "{filename}.mp4".format(filename=project_letter) output_filename = "{filename}.mp4".format(filename=project_letter)
output_options = parse_export_options(project_settings['export_options'], project_settings['vflip'], project_settings['hflip'] ) output_options = project_settings['export_options']
export_filename = os.path.join(savepath, output_filename) export_filename = os.path.join(savepath, output_filename)

Binary file not shown.

View File

@ -5,9 +5,9 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-09-12 18:30+0200\n" "POT-Creation-Date: 2024-11-01 07:59+0100\n"
"PO-Revision-Date: 2024-09-12 18:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: arthus <arthus@ateliers>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -15,91 +15,104 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
#: ../frame_opencv.py:50 #: ../frame_opencv.py:53
msgid "No configuration file found, using defaults." msgid "No configuration file found, using defaults."
msgstr "" msgstr ""
#: ../frame_opencv.py:61 #: ../frame_opencv.py:65
msgid "Found configuration file in {}" msgid "Found configuration file in {}"
msgstr "" msgstr ""
#: ../frame_opencv.py:99
msgid "Unknown setting!"
msgstr ""
#: ../frame_opencv.py:105 #: ../frame_opencv.py:105
msgid "Camera function not supported."
msgstr ""
#: ../frame_opencv.py:144
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: ../frame_opencv.py:119 #: ../frame_opencv.py:158
msgid "No" msgid "No"
msgstr "" msgstr ""
#: ../frame_opencv.py:195 #: ../frame_opencv.py:234
msgid "" msgid ""
"A previous session was found in\n {},\n" "A previous session was found in\n"
" {},\n"
" resume shooting ?" " resume shooting ?"
msgstr "" msgstr ""
#: ../frame_opencv.py:206 #: ../frame_opencv.py:245
msgid "Using {} as session folder." msgid "Using {} as session folder."
msgstr "" msgstr ""
#: ../frame_opencv.py:322 #: ../frame_opencv.py:355
msgid "{} does not exist" msgid "{} does not exist"
msgstr "" msgstr ""
#: ../frame_opencv.py:343 #: ../frame_opencv.py:376
msgid "Removing {}" msgid "Removing {}"
msgstr "" msgstr ""
#: ../frame_opencv.py:364 #: ../frame_opencv.py:395
msgid "Warning: unable to open video source: {}" msgid "Warning: unable to open video source: {}"
msgstr "" msgstr ""
#: ../frame_opencv.py:405 #: ../frame_opencv.py:436
msgid "No camera device found. Exiting..." msgid "No camera device found. Exiting..."
msgstr "" msgstr ""
#: ../frame_opencv.py:523 #: ../frame_opencv.py:489
msgid "Failed to grab frame." msgid "Failed to grab frame."
msgstr "" msgstr ""
#: ../frame_opencv.py:566 #: ../frame_opencv.py:538
msgid "Reset camera settings"
msgstr ""
#: ../frame_opencv.py:543
msgid "Export" msgid "Export"
msgstr "" msgstr ""
#: ../frame_opencv.py:570 #: ../frame_opencv.py:547
msgid "Playback" msgid "Playback"
msgstr "" msgstr ""
#: ../frame_opencv.py:577 #: ../frame_opencv.py:554
msgid "Remove frame" msgid "Remove frame"
msgstr "" msgstr ""
#: ../frame_opencv.py:582 #: ../frame_opencv.py:559
msgid "Escape hit, exiting..." msgid "Escape hit, exiting..."
msgstr "" msgstr ""
#: ../frame_opencv.py:585 #: ../frame_opencv.py:562
msgid "Ctrl-C hit, exiting..." msgid "Ctrl-C hit, exiting..."
msgstr "" msgstr ""
#: ../frame_opencv.py:588 #: ../frame_opencv.py:565
msgid "Window was closed, exiting..." msgid "Window was closed, exiting..."
msgstr "" msgstr ""
#: ../frame_opencv.py:596 #: ../frame_opencv.py:573
msgid "File {} written." msgid "File {} written."
msgstr "" msgstr ""
#: ../frame_opencv.py:613 ../frame_opencv.py:614 #: ../frame_opencv.py:589 ../frame_opencv.py:590
msgid "" msgid ""
"Ffmpeg is still running.\n" "Ffmpeg is still running.\n"
" Waiting for task to complete." " Waiting for task to complete."
msgstr "" msgstr ""
#: ../frame_opencv.py:623 #: ../frame_opencv.py:599
msgid "Terminating running process..." msgid "Terminating running process..."
msgstr "" msgstr ""
#: ../frame_opencv.py:642 #: ../frame_opencv.py:619
msgid "No images yet! Start shooting..." msgid "No images yet! Start shooting..."
msgstr "" msgstr ""

Binary file not shown.

View File

@ -6,10 +6,10 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-09-12 16:29+0200\n" "POT-Creation-Date: 2024-09-12 16:29+0200\n"
"PO-Revision-Date: 2024-09-12 18:31+0200\n" "PO-Revision-Date: 2024-11-01 09:18+0100\n"
"Last-Translator: arthus <arthus@ateliers>\n" "Last-Translator: arthus <arthus@ateliers>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: French\n" "Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -35,6 +35,7 @@ msgstr "Non"
msgid "A previous session was found in\n {},\n resume shooting ?" msgid "A previous session was found in\n {},\n resume shooting ?"
msgstr "Une session précédente à été trouvée dans\n {},\n reprendre la session ?" msgstr "Une session précédente à été trouvée dans\n {},\n reprendre la session ?"
#: ../frame_opencv.py:206 #: ../frame_opencv.py:206
msgid "Using {} as session folder." msgid "Using {} as session folder."
msgstr "Utilisation de {} comme dossier de session." msgstr "Utilisation de {} comme dossier de session."
@ -49,11 +50,11 @@ msgstr "Suppression de {}"
#: ../frame_opencv.py:384 #: ../frame_opencv.py:384
msgid "Warning: unable to open video source: {}" msgid "Warning: unable to open video source: {}"
msgstr "Attention: périphérique vidéo introuvable : {}" msgstr ""
#: ../frame_opencv.py:425 #: ../frame_opencv.py:425
msgid "No camera device found. Exiting..." msgid "No camera device found. Exiting..."
msgstr "Aucune caméra trouvée. Fermeture..." msgstr "Attention: périphérique vidéo introuvable : {}"
#: ../frame_opencv.py:542 #: ../frame_opencv.py:542
msgid "Failed to grab frame." msgid "Failed to grab frame."
@ -99,39 +100,40 @@ msgstr "Terminaison des processus en cours..."
msgid "No images yet! Start shooting..." msgid "No images yet! Start shooting..."
msgstr "Aucune image! Commencez à tourner..." msgstr "Aucune image! Commencez à tourner..."
#~ msgid "Warning: Some settings are not set to the recommended value!"
#~ msgstr "Attention: certains paramètres ne sont pas optimaux!"
#~ msgid "" msgid "Warning: Some settings are not set to the recommended value!"
#~ "\n" msgstr "Attention: certains paramètres ne sont pas optimaux!"
#~ "Camera not found or busy."
#~ msgstr ""
#~ "\n"
#~ "Caméra introuvable ou occupée."
#~ msgid "Resume session?" msgid ""
#~ msgstr "Reprendre la session ?" "\n"
"Camera not found or busy."
msgstr ""
"\n"
"Caméra introuvable ou occupée."
#~ msgid "Image is being saved to {}" msgid "Resume session?"
#~ msgstr "Image sauvegardée dans {}" msgstr "Reprendre la session ?"
#~ msgid "speed too high" msgid "Image is being saved to {}"
#~ msgstr "Vitesse trop élevée." msgstr "Image sauvegardée dans {}"
#~ msgid "Speed too low." msgid "speed too high"
#~ msgstr "Vitesse trop basse." msgstr "Vitesse trop élevée."
#~ msgid "Saving {}{}" msgid "Speed too low."
#~ msgstr "Enregistrement de {}{}" msgstr "Vitesse trop basse."
#~ msgid "Getting file {}" msgid "Saving {}{}"
#~ msgstr "Récupération du fichier {}" msgstr "Enregistrement de {}{}"
#~ msgid "Ending thread" msgid "Getting file {}"
#~ msgstr "Terminaison du processus." msgstr "Récupération du fichier {}"
#~ msgid "Exporting to {}" msgid "Ending thread"
#~ msgstr "Exportation dans {}" msgstr "Terminaison du processus."
#~ msgid "Mp4 files" msgid "Exporting to {}"
#~ msgstr "Fichier Mp4" msgstr "Exportation dans {}"
msgid "Mp4 files"
msgstr "Fichier Mp4"

View File

@ -1,100 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-02-18 11:30+0100\n"
"PO-Revision-Date: 2024-09-09 12:28+0200\n"
"Last-Translator: arthus <arthus@ateliers>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
msgid "Yes"
msgstr "Oui"
msgid "No"
msgstr "Non"
#: ../main_c.py:96
msgid "No configuration file found, using defaults."
msgstr "Aucun fichier de configuration trouvé, utilisation des valeurs par défaut."
#: ../main_c.py:87
msgid "Found configuration file in {}"
msgstr "Fichier de configuration trouvé dans {}"
#: ../main_c.py:156
msgid "No images yet! Start shooting..."
msgstr "Aucune image! Commencez à tourner..."
#: ../main_c.py:144
msgid "Warning: Some settings are not set to the recommended value!"
msgstr "Attention: certains paramètres ne sont pas optimaux!"
#: ../main_c.py:146
msgid ""
"\n"
"Camera not found or busy."
msgstr "\nCaméra introuvable ou occupée."
#: ../main_c.py:256
msgid "A previous session was found in {},\n resume shooting ?"
msgstr "Une session précédente à été trouvée dans {},\n reprendre la session ?"
#: ../main_c.py:256
msgid "Resume session?"
msgstr "Reprendre la session ?"
#: ../main_c.py:263
msgid "Using {} as session folder."
msgstr "Utilisation de {} comme dossier de session."
#: ../main_c.py:281
msgid "Image is being saved to {}"
msgstr "Image sauvegardée dans {}"
#: ../main_c.py:320
msgid "{} does not exist"
msgstr "{} n'existe pas."
#: ../main_c.py:345
msgid "Removing {}"
msgstr "Suppression de {}"
#: ../main_c.py:563
msgid "speed too high"
msgstr "Vitesse trop élevée."
#: ../main_c.py:576
msgid "Speed too low."
msgstr "Vitesse trop basse."
#: ../main_c.py:604
msgid "Saving {}{}"
msgstr "Enregistrement de {}{}"
#: ../main_c.py:606
msgid "Getting file {}"
msgstr "Récupération du fichier {}"
#: ../main_c.py:621
msgid "Ending thread"
msgstr "Terminaison du processus."
#: ../main_c.py:650
msgid "Exporting to {}"
msgstr "Exportation dans {}"
msgid "Mp4 files"
msgstr "Fichier Mp4"
msgid "Ffmpeg is still running.\n Waiting for task to complete."
msgstr "Ffmpeg est toujours en cours d'éxécution.\n Attente de la fin du processus.'"
msgid "Terminating running process..."
msgstr "Terminaison des processus en cours..."

View File

@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# /usr/lib/python3.11/Tools/i18n/pygettext.py -o template.pot ../app.py # /usr/lib/python3.11/Tools/i18n/pygettext.py -o template.pot ../app.py
# #
# /usr/lib/python3.12/Tools/i18n/pygettext.py -o template.pot ../frame_opencv.py
# msgmerge -N template.pot fr/LC_MESSAGES/template.pot -o new.pot
# Change to script dir # Change to script dir
cd "$(dirname "$0")" cd "$(dirname "$0")"
for locale in */LC_MESSAGES/template.pot; do for locale in */LC_MESSAGES/template.pot; do

View File

@ -1,105 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-09-12 16:29+0200\n"
"PO-Revision-Date: 2024-09-12 17:55+0200\n"
"Last-Translator: arthus <arthus@ateliers>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
#: ../frame_opencv.py:50
msgid "No configuration file found, using defaults."
msgstr ""
#: ../frame_opencv.py:61
msgid "Found configuration file in {}"
msgstr ""
#: ../frame_opencv.py:105
msgid "Yes"
msgstr ""
#: ../frame_opencv.py:119
msgid "No"
msgstr ""
#: ../frame_opencv.py:195
msgid ""
"A previous session was found in {},\n"
" resume shooting ?"
msgstr ""
#: ../frame_opencv.py:206
msgid "Using {} as session folder."
msgstr ""
#: ../frame_opencv.py:322
msgid "{} does not exist"
msgstr ""
#: ../frame_opencv.py:343
msgid "Removing {}"
msgstr ""
#: ../frame_opencv.py:384
msgid "Warning: unable to open video source: {}"
msgstr ""
#: ../frame_opencv.py:425
msgid "No camera device found. Exiting..."
msgstr ""
#: ../frame_opencv.py:542
msgid "Failed to grab frame."
msgstr ""
#: ../frame_opencv.py:585
msgid "Export"
msgstr ""
#: ../frame_opencv.py:589
msgid "Playback"
msgstr ""
#: ../frame_opencv.py:596
msgid "Remove frame"
msgstr ""
#: ../frame_opencv.py:601
msgid "Escape hit, exiting..."
msgstr ""
#: ../frame_opencv.py:604
msgid "Ctrl-C hit, exiting..."
msgstr ""
#: ../frame_opencv.py:607
msgid "Window was closed, exiting..."
msgstr ""
#: ../frame_opencv.py:615
msgid "File {} written."
msgstr ""
#: ../frame_opencv.py:632 ../frame_opencv.py:633
msgid ""
"Ffmpeg is still running.\n"
" Waiting for task to complete."
msgstr ""
#: ../frame_opencv.py:642
msgid "Terminating running process..."
msgstr ""
#: ../frame_opencv.py:661
msgid "No images yet! Start shooting..."
msgstr ""