Skip to content
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

View Video link does not work #53

Open
empireshades opened this issue Jun 27, 2024 · 1 comment
Open

View Video link does not work #53

empireshades opened this issue Jun 27, 2024 · 1 comment

Comments

@empireshades
Copy link

On the main page of the webUI, I click on a thumbnail image and the snapshot window pops up, but when I try to click the View Video link in the bottom left hand corner, I just get a broken video image. This appears to be coming from an internal flask re-routing logic where whosatmyfeeder makes a request to frigate to fetch the video and then send it to the user directly here:

WhosAtMyFeeder/webui.py

Lines 52 to 69 in 787c665

@app.route('/frigate/<frigate_event>/snapshot.jpg')
def frigate_snapshot(frigate_event):
frigate_url = config['frigate']['frigate_url']
try:
# Fetch the image from frigate
print("Getting snapshot from Frigate", flush=True)
response = requests.get(f'{frigate_url}/api/events/{frigate_event}/snapshot.jpg', stream=True)
if response.status_code == 200:
# Serve the image to the client using Flask's send_file()
return send_file(response.raw, mimetype=response.headers['Content-Type'])
else:
# Return the single transparent pixel image from the local file if the actual image is not found
return send_from_directory('static/images', '1x1.png', mimetype='image/png')
except Exception as e:
# If there's any issue fetching the image, return a 500 error
print(f"Error fetching image from frigate: {e}", flush=True)
abort(500)
When I examine the frigate api logs, it appears to have fetched correctly with a 200 so I'm not sure why this isn't working but it seems like it's breaking in line 62: return send_file(response.raw, mimetype=response.headers['Content-Type']). Any ideas? Thanks.

@ando01
Copy link

ando01 commented Jan 16, 2025

@empireshades not sure if you have the same issue that I ran into but check out my closed issue #55 I forked the repo and fixed the code and now the videos play in Safari and on my iPhone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants