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

*.m4a files detected as video instead of audio #118

Open
ronin opened this issue Jan 31, 2025 · 0 comments
Open

*.m4a files detected as video instead of audio #118

ronin opened this issue Jan 31, 2025 · 0 comments

Comments

@ronin
Copy link

ronin commented Jan 31, 2025

Hi

I've been debugging an issue in our app and ended up here. I have *.m4a files containing audio only that are identified as video and this breaks ActiveStorage::Previewer::VideoPreviewer as it tries to extract first frame from non existing video.

I wonder if this is a valid Marcel issue that should be fixed or no? After browsing the source code it looks Marcel philosophy is to just to match magic strings in the content, file extensions or given mime type. To tell if the MP4 container contains actual video, we need to do more processing of the given file I guess.

Or, do something like this: if magic matches video/mp4, but declared type is "audio/x-m4a, then chose the latter. But this does not feel right as well.

I'd appreciate some feedback on this. I can always fix it outside of Marcel by patching video previewer.

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

1 participant