updated to generate trip

This commit is contained in:
2025-07-10 13:46:05 +03:00
parent 4fa7ed2a48
commit 29fd68f732
338 changed files with 12229 additions and 24735 deletions

View File

@@ -7,7 +7,7 @@ import os
import sys
sys.path.append('/home/pi/Desktop/traccar_animation')
from py_scripts.advanced_3d_generator import Advanced3DGenerator
from py_scripts.advanced_3d_generator import NavigationAnimationGenerator
from datetime import datetime
def test_google_earth_animation():
@@ -39,7 +39,7 @@ def test_google_earth_animation():
print(f"Testing Google Earth animation with project: {project_name}")
# Create generator
generator = Advanced3DGenerator(project_folder)
generator = NavigationAnimationGenerator(project_folder)
# Check dependencies
try:
@@ -57,22 +57,36 @@ def test_google_earth_animation():
try:
print("Starting Google Earth flythrough generation...")
success = generator.generate_3d_animation(
# Generate frames
frame_paths = generator.generate_frames(
positions_file,
output_video,
style='google_earth',
progress_callback=progress_callback
)
if success and os.path.exists(output_video):
print(f"SUCCESS! Google Earth flythrough created: {output_video}")
if frame_paths and len(frame_paths) > 0:
print(f"Generated {len(frame_paths)} frames")
# Get file size
file_size = os.path.getsize(output_video) / (1024 * 1024) # MB
print(f"📹 Video size: {file_size:.1f} MB")
# Create video
success = generator.create_video(
frame_paths,
output_video,
progress_callback=progress_callback
)
if success and os.path.exists(output_video):
print(f"✅ SUCCESS! Google Earth flythrough created: {output_video}")
# Get file size
file_size = os.path.getsize(output_video) / (1024 * 1024) # MB
print(f"📹 Video size: {file_size:.1f} MB")
# Clean up frames
generator.cleanup_frames()
else:
print("❌ Failed to create video from frames")
else:
print("❌ Failed to create video")
print("❌ Failed to generate frames")
except Exception as e:
print(f"❌ Error during generation: {e}")