[GH-ISSUE #2250] Video downloads fail to play in Safari due to WebM format and incorrect MIME type metadata #1374

Open
opened 2026-03-02 11:56:51 +03:00 by kerem · 0 comments
Owner

Originally created by @SqREL on GitHub (Dec 13, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2250

Describe the Bug

Bug Summary

Downloaded videos are saved as WebM format but metadata incorrectly reports video/mp4, causing playback failures. Safari cannot play WebM at all.

Environment

  • Karakeep version: 0.29.3
  • Browser: Safari (fails), Chrome (works)
  • OS: Ubuntu (Docker)

Configuration

CRAWLER_VIDEO_DOWNLOAD=true
CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1

Steps to Reproduce

  1. Save a YouTube video URL in Karakeep
  2. Wait for video download to complete
  3. Try to play the video in Safari

Actual Behavior

  • yt-dlp downloads video as .webm (VP9 codec)
  • Metadata saved as {"contentType":"video/mp4"}
  • Safari cannot play WebM — video fails silently
  • Chrome plays it (supports WebM)

Evidence

$ file asset.bin
asset.bin: WebM

$ cat metadata.json
{"contentType":"video/mp4"}

Expected Behavior

Either:

  1. Pass --merge-output-format mp4 to yt-dlp so videos are converted to H.264/MP4 (Safari compatible)
  2. Or at minimum, save correct MIME type (video/webm) in metadata

Suggested Fix

Add to yt-dlp arguments in videoworker.ts:

ytDlpArguments.push("--merge-output-format", "mp4");
  • #792 (Firefox archived video unsupported format)
  • #1842 (yt-dlp -f flag issues)

Steps to Reproduce

  1. Set environment variables:
    CRAWLER_VIDEO_DOWNLOAD=true
    CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1
    
  2. Restart Karakeep containers
  3. Add a new bookmark with YouTube URL (e.g., https://www.youtube.com/watch?v=jZyPsok9RPk)
  4. Wait for video download to complete (check logs for "Video Download Completed successfully")
  5. Open the bookmark in Safari browser
  6. Click play on the embedded video player

Result: Video doesn't play in Safari. Works in Chrome.

Verification:

# Find the downloaded asset
find /data/assets -name "asset.bin" -newer /tmp/marker 2>/dev/null | head -1

# Check actual file format vs metadata
file <path>/asset.bin           # Shows: WebM
cat <path>/metadata.json        # Shows: {"contentType":"video/mp4"}

Expected Behaviour

Videos should play in all major browsers including Safari. This requires either:

  1. Converting downloaded videos to MP4 format (H.264 codec) using yt-dlp's --merge-output-format mp4 flag, since ffmpeg is already available in the container
  2. Or at minimum, saving the correct MIME type in metadata (video/webm for WebM files) so browsers can handle them appropriately

Screenshots or Additional Context

Image

Device Details

Safari Version 26.1 (21622.2.11.11.9)

Exact Karakeep Version

v0.29.3

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem
Originally created by @SqREL on GitHub (Dec 13, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2250 ### Describe the Bug ### Bug Summary Downloaded videos are saved as WebM format but metadata incorrectly reports `video/mp4`, causing playback failures. Safari cannot play WebM at all. ### Environment - Karakeep version: 0.29.3 - Browser: Safari (fails), Chrome (works) - OS: Ubuntu (Docker) ### Configuration ```env CRAWLER_VIDEO_DOWNLOAD=true CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1 ``` ### Steps to Reproduce 1. Save a YouTube video URL in Karakeep 2. Wait for video download to complete 3. Try to play the video in Safari ### Actual Behavior - yt-dlp downloads video as `.webm` (VP9 codec) - Metadata saved as `{"contentType":"video/mp4"}` - Safari cannot play WebM — video fails silently - Chrome plays it (supports WebM) ### Evidence ```bash $ file asset.bin asset.bin: WebM $ cat metadata.json {"contentType":"video/mp4"} ``` ### Expected Behavior Either: 1. Pass `--merge-output-format mp4` to yt-dlp so videos are converted to H.264/MP4 (Safari compatible) 2. Or at minimum, save correct MIME type (`video/webm`) in metadata ### Suggested Fix Add to yt-dlp arguments in `videoworker.ts`: ```typescript ytDlpArguments.push("--merge-output-format", "mp4"); ``` ### Related Issues - #792 (Firefox archived video unsupported format) - #1842 (yt-dlp -f flag issues) ### Steps to Reproduce 1. Set environment variables: ```env CRAWLER_VIDEO_DOWNLOAD=true CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1 ``` 2. Restart Karakeep containers 3. Add a new bookmark with YouTube URL (e.g., `https://www.youtube.com/watch?v=jZyPsok9RPk`) 4. Wait for video download to complete (check logs for "Video Download Completed successfully") 5. Open the bookmark in Safari browser 6. Click play on the embedded video player **Result:** Video doesn't play in Safari. Works in Chrome. **Verification:** ```bash # Find the downloaded asset find /data/assets -name "asset.bin" -newer /tmp/marker 2>/dev/null | head -1 # Check actual file format vs metadata file <path>/asset.bin # Shows: WebM cat <path>/metadata.json # Shows: {"contentType":"video/mp4"} ``` ### Expected Behaviour Videos should play in all major browsers including Safari. This requires either: 1. Converting downloaded videos to MP4 format (H.264 codec) using yt-dlp's `--merge-output-format mp4` flag, since ffmpeg is already available in the container 2. Or at minimum, saving the correct MIME type in metadata (`video/webm` for WebM files) so browsers can handle them appropriately ### Screenshots or Additional Context <img width="1261" height="702" alt="Image" src="https://github.com/user-attachments/assets/7f8f4755-2685-4c03-9b56-2687f30526eb" /> ### Device Details Safari Version 26.1 (21622.2.11.11.9) ### Exact Karakeep Version v0.29.3 ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1374
No description provided.