From b1559227af30d334169d7dcad18fd58947ac43ab Mon Sep 17 00:00:00 2001 From: Scheianu Ionut Date: Sat, 10 May 2025 22:26:07 +0300 Subject: [PATCH] updated --- src/Resurse/app_config.txt | 2 +- src/media_player.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Resurse/app_config.txt b/src/Resurse/app_config.txt index 68aba08..483cf83 100644 --- a/src/Resurse/app_config.txt +++ b/src/Resurse/app_config.txt @@ -1 +1 @@ -{"screen_orientation": "Landscape", "screen_name": "TvHolBa1", "quickconnect_key": "Initial01!", "server_ip": "192.168.0.115", "port": "80"} \ No newline at end of file +{"screen_orientation": "Landscape", "screen_name": "tv-terasa", "quickconnect_key": "8887779", "server_ip": "digi-signage.moto-adv.com", "port": "80"} \ No newline at end of file diff --git a/src/media_player.py b/src/media_player.py index 32a6fa9..773ce41 100644 --- a/src/media_player.py +++ b/src/media_player.py @@ -13,6 +13,7 @@ from kivy.animation import Animation # Import Animation for fade effects import os # Import os for file and directory operations import json # Import json for handling JSON data import datetime # Import datetime for timestamping logs + import subprocess # Import functions from python_functions.py from python_functions import load_playlist, download_media_files, clean_unused_files @@ -333,5 +334,16 @@ class MediaPlayerApp(App): """Switch to the SettingsScreen.""" self.root.current = 'settings' +def convert_video_to_mp4(input_path, output_path): + """Convert a video to H.264 MP4 format.""" + try: + subprocess.run( + ['ffmpeg', '-i', input_path, '-vcodec', 'libx264', '-acodec', 'aac', '-strict', 'experimental', output_path], + check=True + ) + Logger.info(f"Converted video: {input_path} to {output_path}") + except subprocess.CalledProcessError as e: + Logger.error(f"Failed to convert video: {input_path}. Error: {e}") + if __name__ == '__main__': MediaPlayerApp().run() # Run the app \ No newline at end of file