[GH-ISSUE #792] Firefox archived video unsupported format and MIME type found #515

Open
opened 2026-03-02 11:50:30 +03:00 by kerem · 5 comments
Owner

Originally created by @viravera on GitHub (Dec 31, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/792

Describe the Bug

In some downloaded videos from youtube where the file has not been recompressed, such as when the download max size is set to -1, the stream is h264 encoded but firefox can't deal with the matroska container.

In firefox, the message "No video with supported format and MIME type found" is shown in the video player, and the error
Media resource https://files.catbox.moe/6w5twb.mp4 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata is logged in the console.

Steps to Reproduce

CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1
CRAWLER_VIDEO_DOWNLOAD=true

Download a youtube video like https://www.youtube.com/watch?v=Ntraj80qN2k

Expected Behaviour

Archived videos should play in firefox rather than displaying an error about MIME type

Screenshots or Additional Context

I've fixed it in my local instance by specifying the merge output format for yt-dlp in the videoworker.ts file by using the line below.

  ytDlpArguments.push("--merge-output-format", "mp4");

This fix works for me but I think it would annoy some people that prefer the existing .mkv default. Therefore, I suggest adding an environment variable that defaults to the current mkv but that can be user-specified to mp4 or whatever for people who want to be able to use firefox to see their videos. I suspect safari might also have this problem but I didn't bother to check. I would think it should be something like the below:

CRAWLER_VIDEO_MERGE_FORMAT="mp4"

Device Details

Firefox 132, tested on Windows 10 and Ubuntu

Exact Hoarder Version

v0.20.0

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 @viravera on GitHub (Dec 31, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/792 ### Describe the Bug In some downloaded videos from youtube where the file has not been recompressed, such as when the download max size is set to -1, the stream is h264 encoded but firefox can't deal with the matroska container. In firefox, the message "No video with supported format and MIME type found" is shown in the video player, and the error Media resource https://files.catbox.moe/6w5twb.mp4 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006) Details: static MP4Metadata::ResultAndByteBuffer __cdecl mozilla::MP4Metadata::Metadata(mozilla::ByteStream *): Cannot parse metadata is logged in the console. ### Steps to Reproduce CRAWLER_VIDEO_DOWNLOAD_MAX_SIZE=-1 CRAWLER_VIDEO_DOWNLOAD=true Download a youtube video like https://www.youtube.com/watch?v=Ntraj80qN2k ### Expected Behaviour Archived videos should play in firefox rather than displaying an error about MIME type ### Screenshots or Additional Context I've fixed it in my local instance by specifying the merge output format for yt-dlp in the videoworker.ts file by using the line below. ``` ytDlpArguments.push("--merge-output-format", "mp4"); ``` This fix works for me but I think it would annoy some people that prefer the existing .mkv default. Therefore, I suggest adding an environment variable that defaults to the current mkv but that can be user-specified to mp4 or whatever for people who want to be able to use firefox to see their videos. I suspect safari might also have this problem but I didn't bother to check. I would think it should be something like the below: ``` CRAWLER_VIDEO_MERGE_FORMAT="mp4" ``` ### Device Details Firefox 132, tested on Windows 10 and Ubuntu ### Exact Hoarder Version v0.20.0 ### Have you checked the troubleshooting guide? - [X] I have checked the troubleshooting guide and I haven't found a solution to my problem
Author
Owner

@MohamedBassem commented on GitHub (Dec 31, 2024):

We had another user who faced problems with av1 (#778) as well when setting the max size to -1. Would it help to just give full customization to the ytdl arguments via env variables? There are so many arguments, that I feel like we'll end up adding more env variables.

<!-- gh-comment-id:2566333490 --> @MohamedBassem commented on GitHub (Dec 31, 2024): We had another user who faced problems with av1 (#778) as well when setting the max size to -1. Would it help to just give full customization to the ytdl arguments via env variables? There are so many arguments, that I feel like we'll end up adding more env variables.
Author
Owner

@viravera commented on GitHub (Dec 31, 2024):

Yep I agree with your evaluation. By allowing full customization you can provide a sensible default and let people that have specific issues handle it themselves.

<!-- gh-comment-id:2566402114 --> @viravera commented on GitHub (Dec 31, 2024): Yep I agree with your evaluation. By allowing full customization you can provide a sensible default and let people that have specific issues handle it themselves.
Author
Owner

@bverkron commented on GitHub (Dec 31, 2024):

@viravera what was the resolution of the video in hoarder after you applied the "--merge-output-format", "mp4" setting?

<!-- gh-comment-id:2566608965 --> @bverkron commented on GitHub (Dec 31, 2024): @viravera what was the resolution of the video in hoarder after you applied the "--merge-output-format", "mp4" setting?
Author
Owner

@viravera commented on GitHub (Dec 31, 2024):

I just downloaded it to check. It was 1920x1080.

<!-- gh-comment-id:2566728350 --> @viravera commented on GitHub (Dec 31, 2024): I just downloaded it to check. It was 1920x1080.
Author
Owner

@bverkron commented on GitHub (Dec 31, 2024):

Thanks. I just did some experimenting directly inside the Hoarder container and got the same result.

Example:

Start a shell in the container...
docker exec -it hoarder /bin/sh (assuming the container is named 'hoarder')

then...
yt-dlp --merge-output-format=mp4 https://youtu.be/Lw9Y_A5rzOs -o merge-output-test.mp4

For some reason when testing in my local environment Shorts I download with the same settings end up at 360 x 640 even though the original AV1 file is 1080 x 1920. Probably wasn't picking up my local install of ffmpeg for some reason.

Good to know Hoarder is able to download files in MP4 at proper resolution with the right yt-dlp parameters.

<!-- gh-comment-id:2566734929 --> @bverkron commented on GitHub (Dec 31, 2024): Thanks. I just did some experimenting directly inside the Hoarder container and got the same result. Example: Start a shell in the container... `docker exec -it hoarder /bin/sh` (assuming the container is named 'hoarder') then... `yt-dlp --merge-output-format=mp4 https://youtu.be/Lw9Y_A5rzOs -o merge-output-test.mp4` For some reason when testing in my local environment Shorts I download with the same settings end up at 360 x 640 even though the original AV1 file is 1080 x 1920. Probably wasn't picking up my local install of ffmpeg for some reason. Good to know Hoarder is able to download files in MP4 at proper resolution with the right yt-dlp parameters.
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#515
No description provided.