Repository: voxel51/fiftyone

Issue:
[BUG] Video Overlay Aspect Ratio/Zoom/Alignment issue
### Instructions

Thank you for submitting an issue. Please refer to our
[issue policy](https://www.github.com/voxel51/fiftyone/blob/develop/ISSUE_POLICY.md)
for information on what types of issues we address.

**Please fill in this template to ensure a timely and thorough response.**

-   Place an "x" between the brackets next to an option if it applies. Example:
    -   [x] Selected option
-   Please delete this section (all content above this line) before submitting
    the issue

### System information

-   **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
Mac OS 12.4

-   **FiftyOne installed from (pip or source)**:
Seeing this in both.

-   **FiftyOne version (run `fiftyone --version`)**:
0.16.0, also seeing in develop

-   **Python version**:
3.9.13

### Commands to reproduce

```
fiftyone app view --zoo-dataset quickstart-video
```

### Describe the problem

Video labels seem misaligned. Looks like the video is zoomed in.

### Code to reproduce issue

None - just open the app to a video dataset.

### Other info / logs

Include any logs or source code that would be helpful to diagnose the problem.
If including tracebacks, please include the full traceback. Large logs and
files should be attached. Please do not use screenshots for sharing text. Code
snippets should be used instead when providing tracebacks, logs, etc.

### What areas of FiftyOne does this bug affect?

-   [x] `App`: FiftyOne application issue
-   [ ] `Core`: Core `fiftyone` Python library issue
-   [ ] `Server`: Fiftyone server issue


<img width="1394" alt="Screen Shot 2022-05-27 at 8 05 12 AM" src="https://user-images.githubusercontent.com/462228/170728927-255dfb3c-9f79-4815-852e-0724371cc797.png">
<img width="1395" alt="Screen Shot 2022-05-27 at 8 17 22 AM" src="https://user-images.githubusercontent.com/462228/170728941-178e91e5-6d9c-473f-9f4c-926628eac712.png">




Discussion:
I believe you need to install `ffmpeg`. Some rendering logic requires `ffprobe` to compute video dimensions, but if this fails things silently continue.

I think there’s an issue floating around somewhere about how we need to present a more helpful error to the user in this case… you’re not the first to report this!

Currently there’s only a small footnote in the install section of the docs stating that `ffmpeg` must be installed to work with video datasets.

With v0.16.0, backend stack traces are now presented in the App, so addressing this should be as easy as raising the “no ffmpeg found error”
Here it is: https://github.com/voxel51/fiftyone/issues/1255
Closing this in favor of #1255.

Resolving patch:
diff --git a/fiftyone/server/metadata.py b/fiftyone/server/metadata.py
--- a/fiftyone/server/metadata.py
+++ b/fiftyone/server/metadata.py
@@ -62,7 +62,12 @@ async def get_metadata(filepath, metadata=None):
     try:
         # Retrieve media metadata from disk
         metadata = await read_metadata(filepath, is_video)
-    except:
+    except Exception as exc:
+
+        # Immediately fail so the user knows they should install FFmpeg
+        if isinstance(exc, FFprobeNotFoundException):
+            raise exc
+
         # Something went wrong (ie non-existent file), so we gracefully return
         # some placeholder metadata so the App grid can be rendered
         if is_video:
@@ -135,7 +140,7 @@ async def get_stream_info(path):
         a :class:`eta.core.video.VideoStreamInfo`
     """
     if _FFPROBE_BINARY_PATH is None:
-        raise RuntimeError(
+        raise FFprobeNotFoundException(
             "You must have ffmpeg installed on your machine in order to view "
             "video datasets in the App, but we failed to find it"
         )
@@ -322,6 +327,12 @@ async def get_image_dimensions(input):
 
 
 class MetadataException(Exception):
-    """ "Exception raised when metadata for a media file cannot be computed."""
+    """Exception raised when metadata for a media file cannot be computed."""
+
+    pass
+
+
+class FFprobeNotFoundException(MetadataException):
+    """Exception raised when FFprobe cannot be found."""
 
     pass


Test patch: