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

Firefox archived video unsupported format and MIME type found #792

Open
1 task done
viravera opened this issue Dec 31, 2024 · 5 comments
Open
1 task done

Firefox archived video unsupported format and MIME type found #792

viravera opened this issue Dec 31, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@viravera
Copy link

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
@MohamedBassem
Copy link
Collaborator

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.

@MohamedBassem MohamedBassem added the bug Something isn't working label Dec 31, 2024
@viravera
Copy link
Author

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.

@bverkron
Copy link

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

@viravera
Copy link
Author

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

@bverkron
Copy link

bverkron commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants