-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database schema brainstorm #1
Comments
Here's a schema for the key-value pairs you can store in Firestore for each workout video: Firestore Schema:
Example Metadata (Firestore Document):{
"user_id": "user_123",
"exercise_name": "squat",
"reps": 10,
"one_rep_max": 200.0,
"time_start": "2024-09-22T10:00:00Z",
"time_end": "2024-09-22T10:10:00Z",
"location": "Gym XYZ",
"video_url": "gs://your-bucket/videos/user_123/squat_video.mp4",
"audio_url": "gs://your-bucket/audios/user_123/squat_audio.mp3",
"upload_time": "2024-09-22T10:15:00Z",
"analysis_results": {
"0-5": ["squat"],
"5-10": ["rest"]
},
"labels": ["squat", "rest"]
} Code to Split Video into Audio and Video:To extract the audio from a video file, you can use
import ffmpeg
import os
def split_video_audio(video_input_path, output_video_path, output_audio_path):
"""
Split the input video into separate video and audio files using ffmpeg.
Args:
- video_input_path (str): Path to the input video file.
- output_video_path (str): Path to save the extracted video (without audio).
- output_audio_path (str): Path to save the extracted audio.
"""
try:
# Extract video without audio
ffmpeg.input(video_input_path).output(output_video_path, an=None).run()
# Extract audio only
ffmpeg.input(video_input_path).output(output_audio_path, vn=None).run()
print(f"Video saved to {output_video_path}")
print(f"Audio saved to {output_audio_path}")
except ffmpeg.Error as e:
print(f"Error occurred while processing the video: {e}")
raise
# Example usage
video_input = "input_video.mp4"
output_video = "output_video_no_audio.mp4"
output_audio = "output_audio.mp3"
split_video_audio(video_input, output_video, output_audio) How It Works:
You can upload the resulting |
Database Schema: Routine : Schema:
Workout Program: |
Database:
User Info
First Name
Last Name
Email
The text was updated successfully, but these errors were encountered: