import streamlit as st from vision_api_call import VideoProcessingClient import os from cloud_speech import get_transcription from moviepy import VideoFileClip import json from pathlib import Path import tempfile import time def extract_audio(video_path, audio_path): video = VideoFileClip(video_path) audio = video.audio audio.write_audiofile(audio_path, codec="pcm_s16le") # Save as WAV (best for transcription) video.close() def load_css(file_name): """Loads a CSS file and injects it into the Streamlit app.""" try: css_path = Path(__file__).parent / file_name with open(css_path) as f: st.markdown(f'', unsafe_allow_html=True) # st.info(f"Loaded CSS: {file_name}") # Optional: uncomment for debugging except FileNotFoundError: st.error(f"CSS file not found: {file_name}. Make sure it's in the same directory as app.py.") except Exception as e: st.error(f"Error loading CSS file {file_name}: {e}") st.cache_resource() def load_resources(): client = VideoProcessingClient(api_key=api_key, model_name='gemini-2.0-flash') return client if __name__ == "__main__": st.markdown(""" """, unsafe_allow_html=True) load_css("style.css") google_credentials_json = json.loads(st.secrets["GOOGLE_APPLICATION_CREDENTIALS"]) # Write the credentials to a temporary file temp_file = "gcp_credentials.json" with open(temp_file, "w") as f: json.dump(google_credentials_json,f) # Set the environment variable to point to the temporary file os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = temp_file st.title("🎥 AI-Powered Meeting Report Generator") st.write('''AI-Powered Meeting Report Generator is an intelligent tool that automatically analyzes video meetings and generates clear, concise summaries. Designed to save time and boost productivity, it captures key information—so your team can stay aligned without sifting through hours of recordings. If you would like to test without your own meeting video, we can showcase its capabilities based on this sample video of a meeting, or you could upload your own video.''') st.markdown( 'This is the default video which you can test with here', unsafe_allow_html=True ) api_key = st.secrets['GOOGLE_API_KEY'] client = load_resources() # Add a radio button to choose between uploading own video or using the default video video_option = st.radio("Choose a video option", ("Upload your own video", "Use default video")) if video_option == "Upload your own video": # File Uploader uploaded_file = st.file_uploader("Upload a video file (MP4)", type=["mp4"]) if uploaded_file: video_path = "temp_video.mp4" with open(video_path, "wb") as f: f.write(uploaded_file.read()) audio_path = "temp_audio.wav" extract_audio(video_path, audio_path) with st.spinner("Fetching transcript from meeting..."): meeting_transcript = get_transcription() with st.spinner("Uploading video..."): video_file = client.upload_video(video_path) with st.spinner("Processing video..."): client.wait_for_processing() with st.spinner("Generating response.."): response = client.summarize_video(meeting_transcript) st.subheader("📜 Report of the meeting:") st.write(response) elif video_option == "Use default video": with st.spinner("Loading default video..."): time.sleep(2) # Simulate a 2-second delay st.markdown('''## Engineering Key Review Meeting Report - February 18th, 2021 ### 1. Attendance & Attention Analysis - Attendees included: Eric Johnson (host), Christopher, Lily, Craig, Said, Gary, Max, Megan, Paul, and others. - Engagement levels appeared generally high based on active participation and responses to questions. Some discussion topics elicited more engagement than others (e.g., the discussion around MR rate metrics sparked significant back and forth). - Eric Johnson shifted to a question-asking role, as he stated as one of his goals for the meeting. ### 2. Meeting Outline - **Meeting Breakup Proposal**: A proposal to break up the existing meeting into separate meetings for each department, rotating Security and UX every other month, was discussed and tentatively approved, with plans to monitor its effectiveness. - **MR Rate Metrics**: The team discussed the definitions and relevance of the overall and wider MR (Merge Request) rates and the problems, ultimately deciding to focus on the percentage of total MRs coming from the community over time instead. - **Postgres Replication Lag**: The team discussed the ongoing issues with postgres replication lag and assigned responsibility, highlighting the need for dedicated resources, performance tuning, and workload improvements. - **Defect Tracking and SLOs**: The team discussed the progress of defect tracking and SLO (Service Level Objective) achievement and potential issues with the current measurement approach, focusing on open bugs, especially as it relates to the age of those bugs. - **Key Meeting Metrics Review**: The team reviewed the overall key meeting metrics, highlighting the smallest decline in Q4, but also the need to address underlying measurement problems. Narrow MR Rate: The team reviewed the narrow MR rate, attributing the below-target performance to vacation days and other events. ### 3. Sentiment Analysis - The overall emotional tone was generally neutral to positive, with a collaborative and problem-solving atmosphere. - There were moments of mild frustration surrounding the clarity and usefulness of existing metrics, particularly the MR rate metrics. - Enthusiasm was evident when discussing potential solutions and improvements, such as focusing on the percentage of total MRs coming from the community. - Agreement was reached on several key actions, such as trying the new meeting rotation and refining the bug tracking metrics. ### 4. Final Summary The Engineering Key Review on February 18th, 2021, was a productive session focused on refining metrics, addressing performance bottlenecks, and improving team structure. The team engaged in open discussions, identified key areas for improvement, and agreed upon actionable steps to drive progress. The overall tone was collaborative, with a focus on data-driven decision-making and continuous improvement.''') import streamlit.components.v1 as components components.html( """ """,height=0 )